]> git.lizzy.rs Git - minetest.git/blobdiff - src/jthread/jsemaphore.h
OS X compatibility fixes
[minetest.git] / src / jthread / jsemaphore.h
index b62add253d64cedb295a73eecd6ec979df07cc6f..53538da1c553dfb5c6e45b8a11ad52e34a7e6620 100644 (file)
@@ -22,7 +22,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #if defined(WIN32)
 #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>
@@ -43,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_ */