mirror of https://github.com/mgba-emu/mgba.git
All: Fix build on Haiku.
This commit is contained in:
parent
2a8ae75561
commit
abe3432739
|
@ -12,6 +12,8 @@
|
|||
#include <sys/time.h>
|
||||
#if defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||
#include <pthread_np.h>
|
||||
#elif defined(__HAIKU__)
|
||||
#include <OS.h>
|
||||
#endif
|
||||
|
||||
#define THREAD_ENTRY void*
|
||||
|
@ -86,6 +88,9 @@ static inline int ThreadSetName(const char* name) {
|
|||
#elif defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||
pthread_set_name_np(pthread_self(), name);
|
||||
return 0;
|
||||
#elif defined(__HAIKU__)
|
||||
rename_thread(find_thread(NULL), name);
|
||||
return 0;
|
||||
#elif !defined(BUILD_PANDORA) // Pandora's glibc is too old
|
||||
return pthread_setname_np(pthread_self(), name);
|
||||
#else
|
||||
|
|
|
@ -147,7 +147,7 @@ const char* _vdeName(struct VDirEntry* vde) {
|
|||
|
||||
static enum VFSType _vdeType(struct VDirEntry* vde) {
|
||||
struct VDirEntryDE* vdede = (struct VDirEntryDE*) vde;
|
||||
#ifndef WIN32
|
||||
#if !defined(WIN32) && !defined(__HAIKU__)
|
||||
if (vdede->ent->d_type == DT_DIR) {
|
||||
return VFS_DIRECTORY;
|
||||
}
|
||||
|
|
|
@ -166,7 +166,11 @@ static bool _vfdSync(struct VFile* vf, const void* buffer, size_t size) {
|
|||
UNUSED(size);
|
||||
struct VFileFD* vfd = (struct VFileFD*) vf;
|
||||
#ifndef _WIN32
|
||||
#ifdef __HAIKU__
|
||||
futimens(vfd->fd, NULL);
|
||||
#else
|
||||
futimes(vfd->fd, NULL);
|
||||
#endif
|
||||
return fsync(vfd->fd) == 0;
|
||||
#else
|
||||
HANDLE h = (HANDLE) _get_osfhandle(vfd->fd);
|
||||
|
|
Loading…
Reference in New Issue