From 68ad1fa8c5e31c288e9424b0d4876e4dfe364a4a Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 12 Jul 2017 00:16:57 -0400 Subject: [PATCH] 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 | 8 +++---- src/physfs_platforms.h | 4 +--- src/platform_beos.cpp | 50 +++--------------------------------------- src/platform_posix.c | 7 ------ 4 files changed, 8 insertions(+), 61 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c17099b8..842cd632 100644 --- a/CMakeLists.txt +++ b/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} ) diff --git a/src/physfs_platforms.h b/src/physfs_platforms.h index 55ebff06..79a49427 100644 --- a/src/physfs_platforms.h +++ b/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) diff --git a/src/platform_beos.cpp b/src/platform_beos.cpp index 3376c468..dd3b94b9 100644 --- a/src/platform_beos.cpp +++ b/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 #include #include @@ -21,19 +20,6 @@ #include #include #include -#include -#else -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif #include #include @@ -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 ... */ diff --git a/src/platform_posix.c b/src/platform_posix.c index afa5b1ce..5c9da003 100644 --- a/src/platform_posix.c +++ b/src/platform_posix.c @@ -21,10 +21,7 @@ #include #include #include - -#ifndef PHYSFS_PLATFORM_BEOS #include -#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 ... */