diff --git a/CMakeLists.txt b/CMakeLists.txt index e37efcb0..43ceb7fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,7 +145,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "Intel") list(APPEND mi_cflags -Wall -fvisibility=hidden) endif() -if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU|Intel") +if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU|Intel" AND NOT CMAKE_SYSTEM_NAME MATCHES "Haiku") if(MI_LOCAL_DYNAMIC_TLS MATCHES "ON") list(APPEND mi_cflags -ftls-model=local-dynamic) else() diff --git a/src/os.c b/src/os.c index 1d6df907..86ea6cd1 100644 --- a/src/os.c +++ b/src/os.c @@ -31,6 +31,10 @@ terms of the MIT license. A copy of the license can be found in the file #include #endif #endif +#if defined(__HAIKU__) +#define madvise posix_madvise +#define MADV_DONTNEED POSIX_MADV_DONTNEED +#endif #endif /* ----------------------------------------------------------- @@ -882,7 +886,7 @@ static void* mi_os_alloc_huge_os_pagesx(void* addr, size_t size, int numa_node) return VirtualAlloc(addr, size, flags, PAGE_READWRITE); } -#elif defined(MI_OS_USE_MMAP) && (MI_INTPTR_SIZE >= 8) +#elif defined(MI_OS_USE_MMAP) && (MI_INTPTR_SIZE >= 8) && !defined(__HAIKU__) #include #ifndef MPOL_PREFERRED #define MPOL_PREFERRED 1