File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,8 @@ void althrd_setname(const char *name [[maybe_unused]])
128128#endif
129129}
130130
131- #ifdef __APPLE__
131+ /* Do not try using libdispatch on systems where it is absent. */
132+ #if defined(__APPLE__) && ((MAC_OS_X_VERSION_MIN_REQUIRED > 1050) && !defined(__ppc__))
132133
133134namespace al {
134135
Original file line number Diff line number Diff line change 1515#endif
1616
1717#if defined(__APPLE__)
18+ #include < AvailabilityMacros.h>
19+ #if (MAC_OS_X_VERSION_MIN_REQUIRED > 1050) && !defined(__ppc__)
1820#include < dispatch/dispatch.h>
21+ #else
22+ #include < semaphore.h> /* Fallback option for Apple without a working libdispatch */
23+ #endif
1924#elif !defined(_WIN32)
2025#include < semaphore.h>
2126#endif
@@ -27,7 +32,7 @@ namespace al {
2732class semaphore {
2833#ifdef _WIN32
2934 using native_type = void *;
30- #elif defined(__APPLE__)
35+ #elif defined(__APPLE__) && ((MAC_OS_X_VERSION_MIN_REQUIRED > 1050) && !defined(__ppc__))
3136 using native_type = dispatch_semaphore_t ;
3237#else
3338 using native_type = sem_t ;
You can’t perform that action at this time.
0 commit comments