From 7d54518d60ba2aa18a0b6225aeaca39a61d4795b Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Mon, 3 May 2021 14:44:15 +0300 Subject: [PATCH] mdbx: add workaround for GCC 4.8 preprocessor bug. Change-Id: I965cfbcd43596ef896a6b849dd043804bdb3f41f --- src/options.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/options.h b/src/options.h index 2e9deb01..d76b8c44 100644 --- a/src/options.h +++ b/src/options.h @@ -162,7 +162,11 @@ /** Presumed malloc size overhead for each allocation * to adjust allocations to be more aligned. */ #ifndef MDBX_ASSUME_MALLOC_OVERHEAD +#ifdef __SIZEOF_POINTER__ +#define MDBX_ASSUME_MALLOC_OVERHEAD (__SIZEOF_POINTER__ * 2u) +#else #define MDBX_ASSUME_MALLOC_OVERHEAD (sizeof(void *) * 2u) +#endif #elif MDBX_ASSUME_MALLOC_OVERHEAD < 0 || MDBX_ASSUME_MALLOC_OVERHEAD > 64 || \ MDBX_ASSUME_MALLOC_OVERHEAD % 4 #error MDBX_ASSUME_MALLOC_OVERHEAD must be defined in range 0..64 and be multiple of 4