All: Fix build on Haiku.
Augustin Cavalier waddlesplash@gmail.com
Mon, 24 Apr 2017 00:16:11 -0400
3 files changed,
10 insertions(+),
1 deletions(-)
M
include/mgba-util/platform/posix/threading.h
→
include/mgba-util/platform/posix/threading.h
@@ -14,6 +14,8 @@ #include <pthread.h>
#include <sys/time.h> #if defined(__FreeBSD__) || defined(__OpenBSD__) #include <pthread_np.h> +#elif defined(__HAIKU__) +#include <OS.h> #endif #define THREAD_ENTRY void*@@ -87,6 +89,9 @@ #ifdef __APPLE__
return pthread_setname_np(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);
M
src/util/vfs/vfs-dirent.c
→
src/util/vfs/vfs-dirent.c
@@ -147,7 +147,7 @@ }
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; }
M
src/util/vfs/vfs-fd.c
→
src/util/vfs/vfs-fd.c
@@ -166,7 +166,11 @@ UNUSED(buffer);
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; }