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.
This commit is contained in:
parent
c2c1c7ac30
commit
68ad1fa8c5
|
@ -55,10 +55,10 @@ set(LZMA_SRCS
|
||||||
src/lzma/C/Compress/Lzma/LzmaDecode.c
|
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
|
# We add this explicitly, since we don't want CMake to think this
|
||||||
# is a C++ project unless we're on BeOS/Haiku.
|
# is a C++ project unless we're on Haiku.
|
||||||
set(PHYSFS_BEOS_SRCS src/platform_beos.cpp)
|
set(PHYSFS_HAIKU_SRCS src/platform_beos.cpp)
|
||||||
find_library(BE_LIBRARY be)
|
find_library(BE_LIBRARY be)
|
||||||
find_library(ROOT_LIBRARY root)
|
find_library(ROOT_LIBRARY root)
|
||||||
set(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} ${BE_LIBRARY} ${ROOT_LIBRARY})
|
set(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} ${BE_LIBRARY} ${ROOT_LIBRARY})
|
||||||
|
@ -96,7 +96,7 @@ set(PHYSFS_SRCS
|
||||||
src/archiver_slb.c
|
src/archiver_slb.c
|
||||||
src/archiver_iso9660.c
|
src/archiver_iso9660.c
|
||||||
src/archiver_vdf.c
|
src/archiver_vdf.c
|
||||||
${PHYSFS_BEOS_SRCS}
|
${PHYSFS_HAIKU_SRCS}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,11 +14,9 @@
|
||||||
|
|
||||||
#if (defined __HAIKU__)
|
#if (defined __HAIKU__)
|
||||||
# define PHYSFS_PLATFORM_HAIKU 1
|
# define PHYSFS_PLATFORM_HAIKU 1
|
||||||
# define PHYSFS_PLATFORM_BEOS 1
|
|
||||||
# define PHYSFS_PLATFORM_POSIX 1
|
# define PHYSFS_PLATFORM_POSIX 1
|
||||||
#elif ((defined __BEOS__) || (defined __beos__))
|
#elif ((defined __BEOS__) || (defined __beos__))
|
||||||
# define PHYSFS_PLATFORM_BEOS 1
|
# error BeOS support was dropped from PhysicsFS 2.1. Sorry. Try Haiku!
|
||||||
# define PHYSFS_PLATFORM_POSIX 1
|
|
||||||
#elif (defined _WIN32_WCE) || (defined _WIN64_WCE)
|
#elif (defined _WIN32_WCE) || (defined _WIN64_WCE)
|
||||||
# error PocketPC support was dropped from PhysicsFS 2.1. Sorry.
|
# error PocketPC support was dropped from PhysicsFS 2.1. Sorry.
|
||||||
#elif ((defined WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_APP)
|
#elif ((defined WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_APP)
|
||||||
|
|
|
@ -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.
|
* Please see the file LICENSE.txt in the source's root directory.
|
||||||
*
|
*
|
||||||
|
@ -9,9 +9,8 @@
|
||||||
#define __PHYSICSFS_INTERNAL__
|
#define __PHYSICSFS_INTERNAL__
|
||||||
#include "physfs_platforms.h"
|
#include "physfs_platforms.h"
|
||||||
|
|
||||||
#ifdef PHYSFS_PLATFORM_BEOS
|
|
||||||
|
|
||||||
#ifdef PHYSFS_PLATFORM_HAIKU
|
#ifdef PHYSFS_PLATFORM_HAIKU
|
||||||
|
|
||||||
#include <os/kernel/OS.h>
|
#include <os/kernel/OS.h>
|
||||||
#include <os/app/Roster.h>
|
#include <os/app/Roster.h>
|
||||||
#include <os/storage/Volume.h>
|
#include <os/storage/Volume.h>
|
||||||
|
@ -21,19 +20,6 @@
|
||||||
#include <os/storage/Path.h>
|
#include <os/storage/Path.h>
|
||||||
#include <os/kernel/fs_info.h>
|
#include <os/kernel/fs_info.h>
|
||||||
#include <os/device/scsi.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 <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -197,37 +183,7 @@ char *__PHYSFS_platformCalcPrefDir(const char *org, const char *app)
|
||||||
return retval;
|
return retval;
|
||||||
} /* __PHYSFS_platformCalcPrefDir */
|
} /* __PHYSFS_platformCalcPrefDir */
|
||||||
|
|
||||||
|
#endif /* PHYSFS_PLATFORM_HAIKU */
|
||||||
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 */
|
|
||||||
|
|
||||||
/* end of beos.cpp ... */
|
/* end of beos.cpp ... */
|
||||||
|
|
||||||
|
|
|
@ -21,10 +21,7 @@
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
#ifndef PHYSFS_PLATFORM_BEOS
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "physfs_internal.h"
|
#include "physfs_internal.h"
|
||||||
|
|
||||||
|
@ -340,8 +337,6 @@ int __PHYSFS_platformStat(const char *filename, PHYSFS_Stat *st)
|
||||||
} /* __PHYSFS_platformStat */
|
} /* __PHYSFS_platformStat */
|
||||||
|
|
||||||
|
|
||||||
#ifndef PHYSFS_PLATFORM_BEOS /* BeOS has its own code in platform_beos.cpp */
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
pthread_mutex_t mutex;
|
pthread_mutex_t mutex;
|
||||||
|
@ -418,8 +413,6 @@ void __PHYSFS_platformReleaseMutex(void *mutex)
|
||||||
} /* if */
|
} /* if */
|
||||||
} /* __PHYSFS_platformReleaseMutex */
|
} /* __PHYSFS_platformReleaseMutex */
|
||||||
|
|
||||||
#endif /* !PHYSFS_PLATFORM_BEOS */
|
|
||||||
|
|
||||||
#endif /* PHYSFS_PLATFORM_POSIX */
|
#endif /* PHYSFS_PLATFORM_POSIX */
|
||||||
|
|
||||||
/* end of posix.c ... */
|
/* end of posix.c ... */
|
||||||
|
|
Loading…
Reference in New Issue