dln.c: xmalloc_mismatch_p with dlopen

* dln.c (xmalloc_mismatch_p): define only when using dlopen,
  otherwise dlsym is not available too, and should be used then.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-01-03 09:05:18 +00:00
parent 96d19b6cbc
commit 21a2146e1d
1 changed files with 3 additions and 1 deletions

4
dln.c
View File

@ -1243,7 +1243,8 @@ rb_w32_check_imported(HMODULE ext, HMODULE mine)
#define translit_separator(str) (void)(str)
#endif
MAYBE_UNUSED(static bool xmalloc_mismatch_p(void *handle));
#ifdef USE_DLN_DLOPEN
static bool xmalloc_mismatch_p(void *handle);
#ifdef __clang__
#pragma clang diagnostic push
@ -1263,6 +1264,7 @@ xmalloc_mismatch_p(void *handle)
#elif defined(__GNUC__) && (__GNUC__ >= 5)
#pragma GCC diagnostic pop
#endif
#endif
void*
dln_load(const char *file)