From e85c69a0a4b7a067da5c7930505929abffb5f041 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Wed, 29 Aug 2018 15:06:49 -0400 Subject: [PATCH] fix builds with prefix --- malloc.c | 2 +- util.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/malloc.c b/malloc.c index 50a26f1..03e9c07 100644 --- a/malloc.c +++ b/malloc.c @@ -897,7 +897,7 @@ EXPORT void h_free(void *p) { deallocate(p); } -EXPORT void h_cfree(void *ptr) __attribute__((alias("free"))); +EXPORT void h_cfree(void *ptr) ALIAS(h_free); EXPORT size_t h_malloc_usable_size(void *p) { if (p == NULL) { diff --git a/util.h b/util.h index 7917819..fa1eac4 100644 --- a/util.h +++ b/util.h @@ -10,6 +10,9 @@ #define UNUSED __attribute__((unused)) #define EXPORT __attribute__((visibility("default"))) +#define stringify(s) #s +#define ALIAS(f) __attribute__((alias(stringify(f)))) + static inline int ffzl(long x) { return __builtin_ffsl(~x); }