Pārlūkot izejas kodu

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.
Ryan C. Gordon 8 gadi atpakaļ
vecāks
revīzija
68ad1fa8c5
4 mainītis faili ar 8 papildinājumiem un 61 dzēšanām
  1. 4 4
      CMakeLists.txt
  2. 1 3
      src/physfs_platforms.h
  3. 3 47
      src/platform_beos.cpp
  4. 0 7
      src/platform_posix.c

+ 4 - 4
CMakeLists.txt

@@ -55,10 +55,10 @@ set(LZMA_SRCS
     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 @@ set(PHYSFS_SRCS
     src/archiver_slb.c
     src/archiver_iso9660.c
     src/archiver_vdf.c
-    ${PHYSFS_BEOS_SRCS}
+    ${PHYSFS_HAIKU_SRCS}
 )
 
 

+ 1 - 3
src/physfs_platforms.h

@@ -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)

+ 3 - 47
src/platform_beos.cpp

@@ -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
+
 #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 @@ char *__PHYSFS_platformCalcPrefDir(const char *org, const char *app)
     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 ... */
 

+ 0 - 7
src/platform_posix.c

@@ -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 @@ int __PHYSFS_platformStat(const char *filename, PHYSFS_Stat *st)
 } /* __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 @@ void __PHYSFS_platformReleaseMutex(void *mutex)
     } /* if */
 } /* __PHYSFS_platformReleaseMutex */
 
-#endif /* !PHYSFS_PLATFORM_BEOS */
-
 #endif  /* PHYSFS_PLATFORM_POSIX */
 
 /* end of posix.c ... */