summaryrefslogtreecommitdiff
path: root/dln.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2022-03-01 09:44:39 -0500
committerPeter Zhu <peter@peterzhu.ca>2022-03-01 09:44:39 -0500
commit25ad9eabc7e49de61b1c0504c14c5af46bf446ed (patch)
treefddb7f0c146b07500d710aa8e8348011db0aee8a /dln.c
parent210f29a6bfde91beba1773e848843e43554745aa (diff)
Only define RUBY_DLN_CHECK_ABI when supported
Diffstat (limited to 'dln.c')
-rw-r--r--dln.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dln.c b/dln.c
index 6bfd2cd723..6fa68289dd 100644
--- a/dln.c
+++ b/dln.c
@@ -426,7 +426,7 @@ dln_sym(void *handle, const char *symbol)
}
#endif
-#if RUBY_DLN_CHECK_ABI && defined(USE_DLN_DLOPEN)
+#if defined(RUBY_DLN_CHECK_ABI) && defined(USE_DLN_DLOPEN)
static bool
abi_check_enabled_p(void)
{
@@ -441,7 +441,7 @@ dln_load(const char *file)
#if defined(_WIN32) || defined(USE_DLN_DLOPEN)
void *handle = dln_open(file);
-#if RUBY_DLN_CHECK_ABI
+#ifdef RUBY_DLN_CHECK_ABI
unsigned long long (*abi_version_fct)(void) = (unsigned long long(*)(void))dln_sym(handle, "ruby_abi_version");
unsigned long long binary_abi_version = (*abi_version_fct)();
if (binary_abi_version != ruby_abi_version() && abi_check_enabled_p()) {