Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion common/threads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ void althrd_setname(const char *name [[maybe_unused]])
#endif
}

#ifdef __APPLE__
/* Do not try using libdispatch on systems where it is absent. */
#if defined(__APPLE__) && ((MAC_OS_X_VERSION_MIN_REQUIRED > 1050) && !defined(__ppc__))

namespace al {

Expand Down
7 changes: 6 additions & 1 deletion common/threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
#endif

#if defined(__APPLE__)
#include <AvailabilityMacros.h>
#if (MAC_OS_X_VERSION_MIN_REQUIRED > 1050) && !defined(__ppc__)
#include <dispatch/dispatch.h>
#else
#include <semaphore.h> /* Fallback option for Apple without a working libdispatch */
#endif
#elif !defined(_WIN32)
#include <semaphore.h>
#endif
Expand All @@ -27,7 +32,7 @@ namespace al {
class semaphore {
#ifdef _WIN32
using native_type = void*;
#elif defined(__APPLE__)
#elif defined(__APPLE__) && ((MAC_OS_X_VERSION_MIN_REQUIRED > 1050) && !defined(__ppc__))
using native_type = dispatch_semaphore_t;
#else
using native_type = sem_t;
Expand Down