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

ruby-changes:74053

From: Nobuyoshi <ko1@a...>
Date: Mon, 17 Oct 2022 18:36:35 +0900 (JST)
Subject: [ruby-changes:74053] f08fcd0e80 (master): Fix possible use of undefined macros on very old macOS [ci skip]

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

From f08fcd0e803bb07912794b8a2366973946d2af2f Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Mon, 17 Oct 2022 14:46:10 +0900
Subject: Fix possible use of undefined macros on very old macOS [ci skip]

---
 dln.c            | 8 ++++----
 error.c          | 9 +++++++--
 thread_pthread.c | 3 ++-
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/dln.c b/dln.c
index b14ba63c44..bf87251bb6 100644
--- a/dln.c
+++ b/dln.c
@@ -298,15 +298,15 @@ COMPILER_WARNING_POP https://github.com/ruby/ruby/blob/trunk/dln.c#L298
 /* assume others than old Mac OS X have no problem */
 # define dln_disable_dlclose() false
 
-#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
-/* targeting newer versions only */
-# define dln_disable_dlclose() false
-
 #elif !defined(MAC_OS_X_VERSION_10_11) || \
     (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11)
 /* targeting older versions only */
 # define dln_disable_dlclose() true
 
+#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
+/* targeting newer versions only */
+# define dln_disable_dlclose() false
+
 #else
 /* support both versions, and check at runtime */
 # include <sys/sysctl.h>
diff --git a/error.c b/error.c
index b37d139b7c..ceea1c55d1 100644
--- a/error.c
+++ b/error.c
@@ -666,6 +666,11 @@ bug_important_message(FILE *out, const char *const msg, size_t len) https://github.com/ruby/ruby/blob/trunk/error.c#L666
     fwrite(p, 1, endmsg - p, out);
 }
 
+#undef CRASH_REPORTER_MAY_BE_CREATED
+#if defined(__APPLE__) && \
+    (!defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6)
+# define CRASH_REPORTER_MAY_BE_CREATED
+#endif
 static void
 preface_dump(FILE *out)
 {
@@ -674,7 +679,7 @@ preface_dump(FILE *out) https://github.com/ruby/ruby/blob/trunk/error.c#L679
         "-- Crash Report log information "
         "--------------------------------------------\n"
         "   See Crash Report log file in one of the following locations:\n"
-# if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
+# ifdef CRASH_REPORTER_MAY_BE_CREATED
         "     * ~/Library/Logs/CrashReporter\n"
         "     * /Library/Logs/CrashReporter\n"
 # endif
@@ -699,7 +704,7 @@ postscript_dump(FILE *out) https://github.com/ruby/ruby/blob/trunk/error.c#L704
         "[IMPORTANT]"
         /*" ------------------------------------------------"*/
         "\n""Don't forget to include the Crash Report log file under\n"
-# if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
+# ifdef CRASH_REPORTER_MAY_BE_CREATED
         "CrashReporter or "
 # endif
         "DiagnosticReports directory in bug reports.\n"
diff --git a/thread_pthread.c b/thread_pthread.c
index c29c7e1958..aa5435aa99 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -1861,7 +1861,8 @@ native_thread_native_thread_id(rb_thread_t *target_th) https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L1861
     return INT2FIX(tid);
 #elif defined(__APPLE__)
     uint64_t tid;
-# if ((MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6) || \
+# if (!defined(MAC_OS_X_VERSION_10_6) || \
+      (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6) || \
       defined(__POWERPC__) /* never defined for PowerPC platforms */)
     const bool no_pthread_threadid_np = true;
 #   define NO_PTHREAD_MACH_THREAD_NP 1
-- 
cgit v1.2.3


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

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