diff options
author | David CARLIER <devnexen@gmail.com> | 2022-02-21 16:29:14 +0000 |
---|---|---|
committer | David Carlier <devnexen@gmail.com> | 2022-02-22 22:01:26 +0000 |
commit | 40e0507a5959ee218f308d33aec212c3ebeef3bb (patch) | |
tree | c88897117809c6efcb2bb8d839e023990939da13 /src/alloc-override.c | |
parent | ec2265486ecf1d1868afa76c68bcbb8b70dd8fac (diff) |
fix build on older macOs releases, aligned_alloc only from catalina.
closes #549
Diffstat (limited to 'src/alloc-override.c')
-rw-r--r-- | src/alloc-override.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/alloc-override.c b/src/alloc-override.c index 6bbe4aa..fdd951b 100644 --- a/src/alloc-override.c +++ b/src/alloc-override.c @@ -16,6 +16,7 @@ terms of the MIT license. A copy of the license can be found in the file #if defined(MI_MALLOC_OVERRIDE) && !(defined(_WIN32)) #if defined(__APPLE__) +#include <AvailabilityMacros.h> mi_decl_externc void vfree(void* p); mi_decl_externc size_t malloc_size(const void* p); mi_decl_externc size_t malloc_good_size(size_t size); @@ -77,7 +78,9 @@ typedef struct mi_nothrow_s { int _tag; } mi_nothrow_t; MI_INTERPOSE_MI(valloc), MI_INTERPOSE_MI(malloc_size), MI_INTERPOSE_MI(malloc_good_size), + #if defined(MAC_OS_X_VERSION_10_15) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_15 MI_INTERPOSE_MI(aligned_alloc), + #endif #ifdef MI_OSX_ZONE // we interpose malloc_default_zone in alloc-override-osx.c so we can use mi_free safely MI_INTERPOSE_MI(free), |