From 21a2146e1d4a8e7c27e36966bf4bb73cf48e9d7b Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 3 Jan 2018 09:05:18 +0000 Subject: 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 --- dln.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'dln.c') diff --git a/dln.c b/dln.c index 3cad6021cf..3a2960efca 100644 --- a/dln.c +++ b/dln.c @@ -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) -- cgit v1.2.1