]> git.lizzy.rs Git - minetest.git/blobdiff - src/jthread/jsemaphore.h
OS X compatibility fixes
[minetest.git] / src / jthread / jsemaphore.h
index bdce2e4aeb0d338f33950969108b7ef33cea0860..53538da1c553dfb5c6e45b8a11ad52e34a7e6620 100644 (file)
@@ -24,6 +24,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <windows.h>
 #include <assert.h>
 #define MAX_SEMAPHORE_COUNT 1024
+#elif __MACH__
+#include <pthread.h>
+#include <mach/mach.h>
+#include <mach/task.h>
+#include <mach/semaphore.h>
+#include <sys/semaphore.h>
+#include <errno.h>
+#include <time.h>
 #else
 #include <pthread.h>
 #include <semaphore.h>
@@ -44,9 +52,13 @@ class JSemaphore {
 private:
 #if defined(WIN32)
        HANDLE m_hSemaphore;
+#elif __MACH__
+       semaphore_t m_semaphore;
 #else
        sem_t m_semaphore;
 #endif
+    int semcount;
 };
 
+
 #endif /* JSEMAPHORE_H_ */