Skip to content

Commit 25ad9ea

Browse files
committed
Only define RUBY_DLN_CHECK_ABI when supported
1 parent 210f29a commit 25ad9ea

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

dln.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ dln_sym(void *handle, const char *symbol)
426426
}
427427
#endif
428428

429-
#if RUBY_DLN_CHECK_ABI && defined(USE_DLN_DLOPEN)
429+
#if defined(RUBY_DLN_CHECK_ABI) && defined(USE_DLN_DLOPEN)
430430
static bool
431431
abi_check_enabled_p(void)
432432
{
@@ -441,7 +441,7 @@ dln_load(const char *file)
441441
#if defined(_WIN32) || defined(USE_DLN_DLOPEN)
442442
void *handle = dln_open(file);
443443

444-
#if RUBY_DLN_CHECK_ABI
444+
#ifdef RUBY_DLN_CHECK_ABI
445445
unsigned long long (*abi_version_fct)(void) = (unsigned long long(*)(void))dln_sym(handle, "ruby_abi_version");
446446
unsigned long long binary_abi_version = (*abi_version_fct)();
447447
if (binary_abi_version != ruby_abi_version() && abi_check_enabled_p()) {

include/ruby/internal/abi.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,10 @@
2727
/* Windows does not support weak symbols so ruby_abi_version will not exist
2828
* in the shared library. */
2929
#if defined(HAVE_FUNC_WEAK) && !defined(_WIN32) && !defined(__MINGW32__)
30-
# define RUBY_DLN_CHECK_ABI 1
31-
#else
32-
# define RUBY_DLN_CHECK_ABI 0
30+
# define RUBY_DLN_CHECK_ABI
3331
#endif
3432

35-
#if RUBY_DLN_CHECK_ABI
33+
#ifdef RUBY_DLN_CHECK_ABI
3634

3735
RUBY_FUNC_EXPORTED unsigned long long __attribute__((weak))
3836
ruby_abi_version(void)

0 commit comments

Comments
 (0)