diff --git a/src/platform/posix/threading.h b/src/platform/posix/threading.h index e13240f3e..f5f3c8d21 100644 --- a/src/platform/posix/threading.h +++ b/src/platform/posix/threading.h @@ -12,6 +12,8 @@ #include #if defined(__FreeBSD__) || defined(__OpenBSD__) #include +#elif defined(__HAIKU__) +#include #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 diff --git a/src/util/vfs/vfs-dirent.c b/src/util/vfs/vfs-dirent.c index 7104af808..b17ee35bb 100644 --- a/src/util/vfs/vfs-dirent.c +++ b/src/util/vfs/vfs-dirent.c @@ -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; } diff --git a/src/util/vfs/vfs-fd.c b/src/util/vfs/vfs-fd.c index 5b96f58b5..c0f552079 100644 --- a/src/util/vfs/vfs-fd.c +++ b/src/util/vfs/vfs-fd.c @@ -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);