From 7c433ffde2d566d849cd54a881abddad4d7e2f51 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Wed, 15 Jul 2020 09:38:12 +0430 Subject: [PATCH] Add HB_CUSTOM_MALLOC definition So one can use just HB_CUSTOM_MALLOC instead need for define each of hb_*alloc_impl --- src/hb.hh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/hb.hh b/src/hb.hh index d42a54d1d..203267e83 100644 --- a/src/hb.hh +++ b/src/hb.hh @@ -205,10 +205,15 @@ /* Compile-time custom allocator support. */ -#if defined(hb_malloc_impl) \ - && defined(hb_calloc_impl) \ - && defined(hb_realloc_impl) \ - && defined(hb_free_impl) +#if !defined(HB_CUSTOM_MALLOC) \ + && defined(hb_malloc_impl) \ + && defined(hb_calloc_impl) \ + && defined(hb_realloc_impl) \ + && defined(hb_free_impl) +#define HB_CUSTOM_MALLOC +#endif + +#ifdef HB_CUSTOM_MALLOC extern "C" void* hb_malloc_impl(size_t size); extern "C" void* hb_calloc_impl(size_t nmemb, size_t size); extern "C" void* hb_realloc_impl(void *ptr, size_t size);