PR #2067: Simplify the condition for ABSL_HAVE_PTHREAD_CPU_NUMBER_NP

Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/2067

The conditions are always satisfied based on the macOS [lower bound](https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md) that has long moved past the versions being considered here.
Merge 49ed819784 into e3555a1274

Merging this change closes #2067

PiperOrigin-RevId: 926238049
Change-Id: Ib90a33dd1d95eb3acea25a5c09bf367f2b64cfaa
This commit is contained in:
h-vetinari
2026-06-03 13:39:17 -07:00
committed by Copybara-Service
parent bbca5fe5b0
commit 39519d75c2

View File

@@ -71,7 +71,15 @@
// Checks whether pthread_cpu_number_np is available.
#ifdef ABSL_HAVE_PTHREAD_CPU_NUMBER_NP
#error ABSL_HAVE_PTHREAD_CPU_NUMBER_NP cannot be directly set
#elif defined(__APPLE__)
#elif defined(__APPLE__) && defined(__has_include) && \
((defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 110000) || \
(defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && \
__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 140200) || \
(defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && \
__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 70100) || \
(defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && \
__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ >= 140200))
#define ABSL_HAVE_PTHREAD_CPU_NUMBER_NP 1
#endif