mirror of https://github.com/mgba-emu/mgba.git
All: Fix build on Haiku.
This commit is contained in:
parent
86db6fa7e2
commit
953335846b
|
@ -14,6 +14,8 @@ CXX_GUARD_START
|
|||
#include <sys/time.h>
|
||||
#if defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||
#include <pthread_np.h>
|
||||
#elif defined(__HAIKU__)
|
||||
#include <OS.h>
|
||||
#endif
|
||||
|
||||
#define THREAD_ENTRY void*
|
||||
|
@ -88,6 +90,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
|
||||
if (buffer && size) {
|
||||
return msync(buffer, size, MS_SYNC) == 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue