From 8990c349119bc848fe3c776ce02888d82abdef7f Mon Sep 17 00:00:00 2001 From: David Carlier Date: Tue, 13 Oct 2020 21:25:48 +0000 Subject: [PATCH] pass through Haiku build fix. Haiku has a malloc_usable_size api but via the posix layer. --- src/mem/external_alloc.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mem/external_alloc.h b/src/mem/external_alloc.h index 5bda42f..ae35870 100644 --- a/src/mem/external_alloc.h +++ b/src/mem/external_alloc.h @@ -1,6 +1,9 @@ #pragma once #ifdef SNMALLOC_PASS_THROUGH +# if defined(__HAIKU__) +# define _GNU_SOURCE +# endif # include # if defined(_WIN32) //|| defined(__APPLE__) # error "Pass through not supported on this platform" @@ -25,14 +28,13 @@ namespace snmalloc::external_alloc return malloc_size(ptr); } } -# elif defined(__linux__) +# elif defined(__linux__) || defined(__HAIKU__) # include namespace snmalloc::external_alloc { using ::malloc_usable_size; } -# elif defined(__sun) || defined(__HAIKU__) || defined(__NetBSD__) || \ - defined(__OpenBSD__) +# elif defined(__sun) || defined(__NetBSD__) || defined(__OpenBSD__) namespace snmalloc::external_alloc { using ::malloc_usable_size;