1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

dln.c: refine preprocessor conditions by USE_DLN_DLOPEN and _WIN32

This commit is contained in:
Nobuyoshi Nakada 2021-12-17 00:44:54 +09:00
parent fff058a8d6
commit 06bdb41c45
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
Notes: git 2021-12-17 01:56:26 +09:00

8
dln.c
View file

@ -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