From 06bdb41c4587a9cffacd09df473b66c285ed9813 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 17 Dec 2021 00:44:54 +0900 Subject: dln.c: refine preprocessor conditions by USE_DLN_DLOPEN and _WIN32 --- dln.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'dln.c') diff --git a/dln.c b/dln.c index 7d0447db6c..44e8c06d04 100644 --- a/dln.c +++ b/dln.c @@ -200,13 +200,11 @@ dln_strerror(char *message, size_t size) return message; } #define dln_strerror() dln_strerror(message, sizeof message) -#elif ! defined _AIX +#elif defined USE_DLN_DLOPEN static const char * dln_strerror(void) { -#ifdef USE_DLN_DLOPEN return (char*)dlerror(); -#endif } #endif @@ -305,7 +303,7 @@ dln_load(const char *file) #if (defined _WIN32 || defined USE_DLN_DLOPEN) && defined RUBY_EXPORT static const char incompatible[] = "incompatible library version"; #endif -#if !defined(_AIX) && !defined(NeXT) +#if defined _WIN32 || defined USE_DLN_DLOPEN const char *error = 0; #endif @@ -495,7 +493,7 @@ dln_load(const char *file) #endif #endif -#if !defined(_AIX) && !defined(NeXT) +#if defined(_WIN32) || defined(USE_DLN_DLOPEN) failed: dln_loaderror("%s - %s", error, file); #endif -- cgit v1.2.1