Skip to content

Commit f08fcd0

Browse files
committed
Fix possible use of undefined macros on very old macOS [ci skip]
1 parent 85cee29 commit f08fcd0

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

dln.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -298,15 +298,15 @@ COMPILER_WARNING_POP
298298
/* assume others than old Mac OS X have no problem */
299299
# define dln_disable_dlclose() false
300300

301-
#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
302-
/* targeting newer versions only */
303-
# define dln_disable_dlclose() false
304-
305301
#elif !defined(MAC_OS_X_VERSION_10_11) || \
306302
(MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11)
307303
/* targeting older versions only */
308304
# define dln_disable_dlclose() true
309305

306+
#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
307+
/* targeting newer versions only */
308+
# define dln_disable_dlclose() false
309+
310310
#else
311311
/* support both versions, and check at runtime */
312312
# include <sys/sysctl.h>

error.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,11 @@ bug_important_message(FILE *out, const char *const msg, size_t len)
666666
fwrite(p, 1, endmsg - p, out);
667667
}
668668

669+
#undef CRASH_REPORTER_MAY_BE_CREATED
670+
#if defined(__APPLE__) && \
671+
(!defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6)
672+
# define CRASH_REPORTER_MAY_BE_CREATED
673+
#endif
669674
static void
670675
preface_dump(FILE *out)
671676
{
@@ -674,7 +679,7 @@ preface_dump(FILE *out)
674679
"-- Crash Report log information "
675680
"--------------------------------------------\n"
676681
" See Crash Report log file in one of the following locations:\n"
677-
# if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
682+
# ifdef CRASH_REPORTER_MAY_BE_CREATED
678683
" * ~/Library/Logs/CrashReporter\n"
679684
" * /Library/Logs/CrashReporter\n"
680685
# endif
@@ -699,7 +704,7 @@ postscript_dump(FILE *out)
699704
"[IMPORTANT]"
700705
/*" ------------------------------------------------"*/
701706
"\n""Don't forget to include the Crash Report log file under\n"
702-
# if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
707+
# ifdef CRASH_REPORTER_MAY_BE_CREATED
703708
"CrashReporter or "
704709
# endif
705710
"DiagnosticReports directory in bug reports.\n"

thread_pthread.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1861,7 +1861,8 @@ native_thread_native_thread_id(rb_thread_t *target_th)
18611861
return INT2FIX(tid);
18621862
#elif defined(__APPLE__)
18631863
uint64_t tid;
1864-
# if ((MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6) || \
1864+
# if (!defined(MAC_OS_X_VERSION_10_6) || \
1865+
(MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6) || \
18651866
defined(__POWERPC__) /* never defined for PowerPC platforms */)
18661867
const bool no_pthread_threadid_np = true;
18671868
# define NO_PTHREAD_MACH_THREAD_NP 1

0 commit comments

Comments
 (0)