Skip to content

Commit

Permalink
pass through Haiku build fix.
Browse files Browse the repository at this point in the history
Haiku has a malloc_usable_size api but via the posix layer.
  • Loading branch information
devnexen committed Oct 14, 2020
1 parent 49b9856 commit 7aa6a7d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/mem/external_alloc.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#pragma once

#ifdef SNMALLOC_PASS_THROUGH
# if defined(__HAIKU__)
# define _GNU_SOURCE
# endif
# include <stdlib.h>
# if defined(_WIN32) //|| defined(__APPLE__)
# error "Pass through not supported on this platform"
Expand All @@ -25,14 +28,13 @@ namespace snmalloc::external_alloc
return malloc_size(ptr);
}
}
# elif defined(__linux__)
# elif defined(__linux__) || defined(__HAIKU__)
# include <malloc.h>
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;
Expand Down

0 comments on commit 7aa6a7d

Please sign in to comment.