From d3a6597049a2e6e752dee3f8deea667296cd7b2c Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Fri, 21 Oct 2022 00:26:52 +0800 Subject: [PATCH] Use numerical macOS versions --- configure.ac | 6 +++--- dln.c | 4 ++-- error.c | 2 +- file.c | 2 +- random.c | 4 ++-- thread_pthread.c | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index 0e22aabbe5..ebbd13c2f7 100644 --- a/configure.ac +++ b/configure.ac @@ -354,7 +354,7 @@ AS_CASE(["$target_os"], [darwin*], [ AC_MSG_CHECKING(if minimum required OS X version is supported) AC_PREPROC_IFELSE([AC_LANG_SOURCE([[@%:@include - @%:@if MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_5 + @%:@if MAC_OS_X_VERSION_MIN_REQUIRED < 1050 @%:@error pre OS X 10.5 [!<===== pre OS X 10.5 =====>] @%:@endif @@ -3831,11 +3831,11 @@ AS_CASE(["$target_os"], AC_LANG_BOOL_COMPILE_TRY([ @%:@include enum { - least = MAC_OS_X_VERSION_10_7, /* just fail if undefined */ + least = 1070, /* just fail if undefined */ required = MAC_OS_X_VERSION_MIN_REQUIRED, upper /* bigger than MIN_REQUIRED, or */ @%:@ifdef MAC_OS_X_VERSION_10_10 - = MAC_OS_X_VERSION_10_10 + = 101000 @%:@endif };], [required >= least && required < upper])], diff --git a/dln.c b/dln.c index 0edd709bbe..2a7a80ac8d 100644 --- a/dln.c +++ b/dln.c @@ -303,11 +303,11 @@ COMPILER_WARNING_POP # 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) + (MAC_OS_X_VERSION_MAX_ALLOWED < 101100) /* targeting older versions only */ # define dln_disable_dlclose() true -#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11 +#elif MAC_OS_X_VERSION_MIN_REQUIRED >= 101100 /* targeting newer versions only */ # define dln_disable_dlclose() false diff --git a/error.c b/error.c index 67e81d08a0..d7315532e2 100644 --- a/error.c +++ b/error.c @@ -668,7 +668,7 @@ bug_important_message(FILE *out, const char *const msg, size_t len) #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 || defined(__POWERPC__)) /* 10.6 PPC case */ + (!defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MIN_REQUIRED < 1060 || defined(__POWERPC__)) /* 10.6 PPC case */ # define CRASH_REPORTER_MAY_BE_CREATED #endif static void diff --git a/file.c b/file.c index efd15ea8a1..8f10f72acc 100644 --- a/file.c +++ b/file.c @@ -2876,7 +2876,7 @@ utime_failed(struct apply_arg *aa) # if !defined(HAVE_UTIMENSAT) /* utimensat() is not found, runtime check is not needed */ # elif defined(__APPLE__) && \ - (!defined(MAC_OS_X_VERSION_13_0) || (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_13_0)) + (!defined(MAC_OS_X_VERSION_13_0) || (MAC_OS_X_VERSION_MIN_REQUIRED < 130000)) # if defined(__has_attribute) && __has_attribute(availability) typedef int utimensat_func(int, const char *, const struct timespec [2], int); diff --git a/random.c b/random.c index f8879cfb88..5f43236e5b 100644 --- a/random.c +++ b/random.c @@ -485,10 +485,10 @@ fill_random_bytes_urandom(void *seed, size_t size) #endif #if 0 -#elif defined MAC_OS_X_VERSION_10_7 && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7 +#elif defined MAC_OS_X_VERSION_10_7 && MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 # if defined(USE_COMMON_RANDOM) -# elif defined MAC_OS_X_VERSION_10_10 && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 +# elif defined MAC_OS_X_VERSION_10_10 && MAC_OS_X_VERSION_MIN_REQUIRED >= 101000 # define USE_COMMON_RANDOM 1 # else # define USE_COMMON_RANDOM 0 diff --git a/thread_pthread.c b/thread_pthread.c index aa5435aa99..006f0c2fc0 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -1862,11 +1862,11 @@ native_thread_native_thread_id(rb_thread_t *target_th) #elif defined(__APPLE__) uint64_t tid; # if (!defined(MAC_OS_X_VERSION_10_6) || \ - (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6) || \ + (MAC_OS_X_VERSION_MAX_ALLOWED < 1060) || \ defined(__POWERPC__) /* never defined for PowerPC platforms */) const bool no_pthread_threadid_np = true; # define NO_PTHREAD_MACH_THREAD_NP 1 -# elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 +# elif MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 const bool no_pthread_threadid_np = false; # else # if !(defined(__has_attribute) && __has_attribute(availability))