[前][次][番号順一覧][スレッド一覧]

ruby-changes:71302

From: Peter <ko1@a...>
Date: Tue, 1 Mar 2022 23:45:19 +0900 (JST)
Subject: [ruby-changes:71302] 25ad9eabc7 (master): Only define RUBY_DLN_CHECK_ABI when supported

https://git.ruby-lang.org/ruby.git/commit/?id=25ad9eabc7

From 25ad9eabc7e49de61b1c0504c14c5af46bf446ed Mon Sep 17 00:00:00 2001
From: Peter Zhu <peter@p...>
Date: Tue, 1 Mar 2022 09:44:39 -0500
Subject: Only define RUBY_DLN_CHECK_ABI when supported

---
 dln.c                       | 4 ++--
 include/ruby/internal/abi.h | 6 ++----
 2 files changed, 4 insertions(+), 6 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) https://github.com/ruby/ruby/blob/trunk/dln.c#L426
 }
 #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) https://github.com/ruby/ruby/blob/trunk/dln.c#L441
 #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()) {
diff --git a/include/ruby/internal/abi.h b/include/ruby/internal/abi.h
index 78ed4c1875..81899dcd31 100644
--- a/include/ruby/internal/abi.h
+++ b/include/ruby/internal/abi.h
@@ -27,12 +27,10 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/abi.h#L27
 /* Windows does not support weak symbols so ruby_abi_version will not exist
  * in the shared library. */
 #if defined(HAVE_FUNC_WEAK) && !defined(_WIN32) && !defined(__MINGW32__)
-# define RUBY_DLN_CHECK_ABI 1
-#else
-# define RUBY_DLN_CHECK_ABI 0
+# define RUBY_DLN_CHECK_ABI
 #endif
 
-#if RUBY_DLN_CHECK_ABI
+#ifdef RUBY_DLN_CHECK_ABI
 
 RUBY_FUNC_EXPORTED unsigned long long __attribute__((weak))
 ruby_abi_version(void)
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]