summaryrefslogtreecommitdiff
path: root/dln.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-01 07:27:03 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-01 07:27:03 +0000
commit75319221a256459ef979806a14dbb7725d9667a6 (patch)
treeeaee578f9528d395b8d43fbb8dbae770ff7b3f40 /dln.c
parente15f8b2273cf1a956bf16fb5ba70c76196ed06c7 (diff)
dln.c: fix EXTERNAL_PREFIX
* configure.in (EXPORT_PREFIX): revert r50410. * dln.c (EXTERNAL_PREFIX): define by predefined macros. configured EXPORT_PREFIX is different thing. * win32/Makefile.sub: r50414-50415. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dln.c')
-rw-r--r--dln.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/dln.c b/dln.c
index 43f026b..e5269ca 100644
--- a/dln.c
+++ b/dln.c
@@ -106,7 +106,12 @@ dln_loaderror(const char *format, ...)
# define USE_DLN_DLOPEN
#endif
-#define FUNCNAME_PREFIX EXPORT_PREFIX"Init_"
+#if defined(__hp9000s300) || ((defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)) && !defined(__ELF__)) || defined(__BORLANDC__) || defined(NeXT) || defined(__WATCOMC__) || defined(MACOSX_DYLD)
+# define EXTERNAL_PREFIX "_"
+#else
+# define EXTERNAL_PREFIX ""
+#endif
+#define FUNCNAME_PREFIX EXTERNAL_PREFIX"Init_"
#if defined __CYGWIN__ || defined DOSISH
#define isdirsep(x) ((x) == '/' || (x) == '\\')
@@ -1327,7 +1332,7 @@ dln_load(const char *file)
# if defined RUBY_EXPORT
{
static const char incompatible[] = "incompatible library version";
- void *ex = dlsym(handle, EXPORT_PREFIX"ruby_xmalloc");
+ void *ex = dlsym(handle, EXTERNAL_PREFIX"ruby_xmalloc");
if (ex && ex != ruby_xmalloc) {
# if defined __APPLE__