Catch case where we use the Unix code on a non-Unix system that lacks pthreads. stable-2.0
authorRyan C. Gordon <icculus@icculus.org>
Wed, 03 Feb 2010 23:14:11 -0500
branchstable-2.0
changeset 1048 22b96d39d1a2
parent 1046 c266bc57acc1
child 1050 9e4199e57840
Catch case where we use the Unix code on a non-Unix system that lacks pthreads. Thanks, Patrice! (transplanted from 18ae36a7f55bcca606f7d7d5f745f4d9b95e0840)
CMakeLists.txt
platform/unix.c
--- a/CMakeLists.txt	Wed Feb 03 22:50:07 2010 -0500
+++ b/CMakeLists.txt	Wed Feb 03 23:14:11 2010 -0500
@@ -162,8 +162,6 @@
         CHECK_INCLUDE_FILE(pthread.h HAVE_PTHREAD_H)
         IF(HAVE_PTHREAD_H)
             SET(PHYSFS_HAVE_THREAD_SUPPORT TRUE)
-        ELSE(HAVE_PTHREAD_H)
-            ADD_DEFINITIONS(-DPHYSFS_NO_PTHREADS_SUPPORT=1)
         ENDIF(HAVE_PTHREAD_H)
     ENDIF(BEOS)
 ENDIF(UNIX)
@@ -187,6 +185,7 @@
 IF(PHYSFS_HAVE_THREAD_SUPPORT)
     ADD_DEFINITIONS(-D_REENTRANT -D_THREAD_SAFE)
 ELSE(PHYSFS_HAVE_THREAD_SUPPORT)
+    ADD_DEFINITIONS(-DPHYSFS_NO_THREAD_SUPPORT=1)
     MESSAGE(WARNING " ***")
     MESSAGE(WARNING " *** There is no thread support in this build!")
     MESSAGE(WARNING " *** PhysicsFS will NOT be reentrant!")
--- a/platform/unix.c	Wed Feb 03 22:50:07 2010 -0500
+++ b/platform/unix.c	Wed Feb 03 23:14:11 2010 -0500
@@ -25,7 +25,7 @@
 #include <errno.h>
 #include <sys/mount.h>
 
-#if (!defined PHYSFS_NO_PTHREADS_SUPPORT)
+#if (!defined PHYSFS_NO_THREAD_SUPPORT)
 #include <pthread.h>
 #endif
 
@@ -329,7 +329,7 @@
 } /* __PHYSFS_platformSetDefaultAllocator */
 
 
-#if (defined PHYSFS_NO_PTHREADS_SUPPORT)
+#if (defined PHYSFS_NO_THREAD_SUPPORT)
 
 PHYSFS_uint64 __PHYSFS_platformGetThreadID(void) { return(0x0001); }
 void *__PHYSFS_platformCreateMutex(void) { return((void *) 0x0001); }
@@ -427,7 +427,7 @@
     } /* if */
 } /* __PHYSFS_platformReleaseMutex */
 
-#endif /* !PHYSFS_NO_PTHREADS_SUPPORT */
+#endif /* !PHYSFS_NO_THREAD_SUPPORT */
 
 #endif /* PHYSFS_PLATFORM_UNIX */