Removed BeOS support (Haiku still supported, though!).
authorRyan C. Gordon <icculus@icculus.org>
Wed, 12 Jul 2017 00:16:57 -0400
changeset 1443 0e74405d587f
parent 1442 3cf4fbec7b54
child 1444 70f8dc26109c
Removed BeOS support (Haiku still supported, though!). Since Haiku has pthread support, dropped the BLocker code and use the pthread code from platform_posix.c instead.
CMakeLists.txt
src/physfs_platforms.h
src/platform_beos.cpp
src/platform_posix.c
--- a/CMakeLists.txt	Tue Jul 11 23:52:13 2017 -0400
+++ b/CMakeLists.txt	Wed Jul 12 00:16:57 2017 -0400
@@ -55,10 +55,10 @@
     src/lzma/C/Compress/Lzma/LzmaDecode.c
 )
 
-if(HAIKU OR BEOS)
+if(HAIKU)
     # We add this explicitly, since we don't want CMake to think this
-    #  is a C++ project unless we're on BeOS/Haiku.
-    set(PHYSFS_BEOS_SRCS src/platform_beos.cpp)
+    #  is a C++ project unless we're on Haiku.
+    set(PHYSFS_HAIKU_SRCS src/platform_beos.cpp)
     find_library(BE_LIBRARY be)
     find_library(ROOT_LIBRARY root)
     set(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} ${BE_LIBRARY} ${ROOT_LIBRARY})
@@ -96,7 +96,7 @@
     src/archiver_slb.c
     src/archiver_iso9660.c
     src/archiver_vdf.c
-    ${PHYSFS_BEOS_SRCS}
+    ${PHYSFS_HAIKU_SRCS}
 )
 
 
--- a/src/physfs_platforms.h	Tue Jul 11 23:52:13 2017 -0400
+++ b/src/physfs_platforms.h	Wed Jul 12 00:16:57 2017 -0400
@@ -14,11 +14,9 @@
 
 #if (defined __HAIKU__)
 #  define PHYSFS_PLATFORM_HAIKU 1
-#  define PHYSFS_PLATFORM_BEOS 1
 #  define PHYSFS_PLATFORM_POSIX 1
 #elif ((defined __BEOS__) || (defined __beos__))
-#  define PHYSFS_PLATFORM_BEOS 1
-#  define PHYSFS_PLATFORM_POSIX 1
+#  error BeOS support was dropped from PhysicsFS 2.1. Sorry. Try Haiku!
 #elif (defined _WIN32_WCE) || (defined _WIN64_WCE)
 #  error PocketPC support was dropped from PhysicsFS 2.1. Sorry.
 #elif ((defined WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_APP)
--- a/src/platform_beos.cpp	Tue Jul 11 23:52:13 2017 -0400
+++ b/src/platform_beos.cpp	Wed Jul 12 00:16:57 2017 -0400
@@ -1,5 +1,5 @@
 /*
- * BeOS platform-dependent support routines for PhysicsFS.
+ * Haiku platform-dependent support routines for PhysicsFS.
  *
  * Please see the file LICENSE.txt in the source's root directory.
  *
@@ -9,9 +9,8 @@
 #define __PHYSICSFS_INTERNAL__
 #include "physfs_platforms.h"
 
-#ifdef PHYSFS_PLATFORM_BEOS
+#ifdef PHYSFS_PLATFORM_HAIKU
 
-#ifdef PHYSFS_PLATFORM_HAIKU
 #include <os/kernel/OS.h>
 #include <os/app/Roster.h>
 #include <os/storage/Volume.h>
@@ -21,19 +20,6 @@
 #include <os/storage/Path.h>
 #include <os/kernel/fs_info.h>
 #include <os/device/scsi.h>
-#include <os/support/Locker.h>
-#else
-#include <be/kernel/OS.h>
-#include <be/app/Roster.h>
-#include <be/storage/Volume.h>
-#include <be/storage/VolumeRoster.h>
-#include <be/storage/Directory.h>
-#include <be/storage/Entry.h>
-#include <be/storage/Path.h>
-#include <be/kernel/fs_info.h>
-#include <be/device/scsi.h>
-#include <be/support/Locker.h>
-#endif
 
 #include <errno.h>
 #include <unistd.h>
@@ -197,37 +183,7 @@
     return retval;
 } /* __PHYSFS_platformCalcPrefDir */
 
-
-void *__PHYSFS_platformGetThreadID(void)
-{
-    return (void *) find_thread(NULL);
-} /* __PHYSFS_platformGetThreadID */
-
-
-void *__PHYSFS_platformCreateMutex(void)
-{
-    return new BLocker("PhysicsFS lock", true);
-} /* __PHYSFS_platformCreateMutex */
-
-
-void __PHYSFS_platformDestroyMutex(void *mutex)
-{
-    delete ((BLocker *) mutex);
-} /* __PHYSFS_platformDestroyMutex */
-
-
-int __PHYSFS_platformGrabMutex(void *mutex)
-{
-    return ((BLocker *) mutex)->Lock() ? 1 : 0;
-} /* __PHYSFS_platformGrabMutex */
-
-
-void __PHYSFS_platformReleaseMutex(void *mutex)
-{
-    ((BLocker *) mutex)->Unlock();
-} /* __PHYSFS_platformReleaseMutex */
-
-#endif  /* PHYSFS_PLATFORM_BEOS */
+#endif  /* PHYSFS_PLATFORM_HAIKU */
 
 /* end of beos.cpp ... */
 
--- a/src/platform_posix.c	Tue Jul 11 23:52:13 2017 -0400
+++ b/src/platform_posix.c	Wed Jul 12 00:16:57 2017 -0400
@@ -21,10 +21,7 @@
 #include <dirent.h>
 #include <errno.h>
 #include <fcntl.h>
-
-#ifndef PHYSFS_PLATFORM_BEOS
 #include <pthread.h>
-#endif
 
 #include "physfs_internal.h"
 
@@ -340,8 +337,6 @@
 } /* __PHYSFS_platformStat */
 
 
-#ifndef PHYSFS_PLATFORM_BEOS  /* BeOS has its own code in platform_beos.cpp */
-
 typedef struct
 {
     pthread_mutex_t mutex;
@@ -418,8 +413,6 @@
     } /* if */
 } /* __PHYSFS_platformReleaseMutex */
 
-#endif /* !PHYSFS_PLATFORM_BEOS */
-
 #endif  /* PHYSFS_PLATFORM_POSIX */
 
 /* end of posix.c ... */