Solve threading bug for new macos versions without pthread extensions.
#include <share.h>
#endif
#elif defined(__linux__) || \
- ((defined(__APPLE__) && defined(__MACH__)) || defined(__MACOSX__) && (!defined(MAC_OS_X_VERSION_10_12) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12))
+ ((defined(__APPLE__) && defined(__MACH__)) || defined(__MACOSX__)
#define _GNU_SOURCE
#include <unistd.h>
#include <sys/syscall.h>
#include <sys/types.h>
-#elif ((defined(__APPLE__) && defined(__MACH__)) || defined(__MACOSX__)) && (defined(MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12)
- #include <pthread.h>
#elif defined(__FreeBSD__)
#include <sys/thr.h>
#elif defined(__HAIKU__) || defined(__BEOS__)
@@ -71,15 +69,7 @@ uint64_t thread_id_get_current(void)
return (uint64_t)syscall(SYS_gettid);
#endif
#elif (defined(__APPLE__) && defined(__MACH__)) || defined(__MACOSX__)
- #if defined(MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12
- uint64_t thread_id;
-
- pthread_threadid_np(NULL, &thread_id);
-
- return (uint64_t)thread_id;
- #else
return (uint64_t)syscall(SYS_thread_selfid);
- #endif
#elif defined(__FreeBSD__)
long thread_id = 0;
