bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gawk] [PATCH 1/2] Fix dlsym() failures on OS/2 kLIBC


From: KO Myung-Hun
Subject: [bug-gawk] [PATCH 1/2] Fix dlsym() failures on OS/2 kLIBC
Date: Wed, 11 Oct 2017 22:32:24 +0900

OS/2 kLIBC prepends '_' to symbols.
---
 ext.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/ext.c b/ext.c
index 027df697..eb50001b 100644
--- a/ext.c
+++ b/ext.c
@@ -35,7 +35,13 @@ extern SRCFILE *srcfiles;
 
 #include <dlfcn.h>
 
-#define INIT_FUNC      "dl_load"
+#ifdef __KLIBC__
+#define SYMBOL_PREFIX "_"
+#else
+#define SYMBOL_PREFIX
+#endif
+
+#define INIT_FUNC      SYMBOL_PREFIX "dl_load"
 
 /* load_ext --- load an external library */
 
@@ -61,7 +67,7 @@ load_ext(const char *lib_name)
                      dlerror());
 
        /* Per the GNU Coding standards */
-       gpl_compat = (int *) dlsym(dl, "plugin_is_GPL_compatible");
+       gpl_compat = (int *) dlsym(dl, SYMBOL_PREFIX 
"plugin_is_GPL_compatible");
        if (gpl_compat == NULL)
                fatal(_("load_ext: library `%s': does not define 
`plugin_is_GPL_compatible' (%s)\n"),
                                lib_name, dlerror());
-- 
2.13.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]