From 3c6cc53a0af0bf3f307f7f68fff469417176b518 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Thu, 30 May 2019 23:14:30 -0400 Subject: [PATCH] Okay something is definitely not right. --- sharedbits/alloc_header.h | 4 +++- sharedbits/alloc_impl.h | 4 +++- sharedbits/array_header.h | 4 +++- sharedbits/array_impl.h | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/sharedbits/alloc_header.h b/sharedbits/alloc_header.h index 2a6a414a..0b44d29d 100644 --- a/sharedbits/alloc_header.h +++ b/sharedbits/alloc_header.h @@ -4,7 +4,8 @@ #error you must define sharedbitsPrefix before including this #endif #define sharedbitsPrefixMakeName(x, y) x ## y -#define sharedbitsPrefixName(Name) sharedbitsPrefixMakeName(sharedbitsPrefix, Name) +#define sharedbitsPrefixExpand(x) x +#define sharedbitsPrefixName(Name) sharedbitsPrefixMakeName(sharedbitsPrefixExpand(sharedbitsPrefix), Name) extern void *sharedbitsPrefixName(Alloc)(size_t n, const char *what); extern void *sharedbitsPrefixName(Realloc)(void *p, size_t nOld, size_t nNew, const char *what); @@ -19,4 +20,5 @@ you may also want to define the following: */ #undef sharedbitsPrefixName +#undef sharedbitsPrefixExpand #undef sharedbitsPrefixMakeName diff --git a/sharedbits/alloc_impl.h b/sharedbits/alloc_impl.h index e6c194e6..93e5979c 100644 --- a/sharedbits/alloc_impl.h +++ b/sharedbits/alloc_impl.h @@ -5,7 +5,8 @@ #error you must define sharedbitsPrefix before including this #endif #define sharedbitsPrefixMakeName(x, y) x ## y -#define sharedbitsPrefixName(Name) sharedbitsPrefixMakeName(sharedbitsPrefix, Name) +#define sharedbitsPrefixExpand(x) x +#define sharedbitsPrefixName(Name) sharedbitsPrefixMakeName(sharedbitsPrefixExpand(sharedbitsPrefix), Name) extern void sharedbitsPrefixName(InternalError)(const char *fmt, ...); @@ -36,4 +37,5 @@ void sharedbitsPrefixName(Free)(void *p) } #undef sharedbitsPrefixName +#undef sharedbitsPrefixExpand #undef sharedbitsPrefixMakeName diff --git a/sharedbits/array_header.h b/sharedbits/array_header.h index db2ad9f4..6832ac85 100644 --- a/sharedbits/array_header.h +++ b/sharedbits/array_header.h @@ -5,7 +5,9 @@ #error you must define sharedbitsPrefix before including this #endif #define sharedbitsPrefixMakeName(x, y) x ## y -#define sharedbitsPrefixName(Name) sharedbitsPrefixMakeName(sharedbitsPrefix, Name) +#define sharedbitsPrefixExpand(x) x +#define sharedbitsPrefixName(Name) sharedbitsPrefixMakeName(sharedbitsPrefixExpand(sharedbitsPrefix), Name) #undef sharedbitsPrefixName +#undef sharedbitsPrefixExpand #undef sharedbitsPrefixMakeName diff --git a/sharedbits/array_impl.h b/sharedbits/array_impl.h index 1eda47af..a86abbaf 100644 --- a/sharedbits/array_impl.h +++ b/sharedbits/array_impl.h @@ -5,7 +5,9 @@ #error you must define sharedbitsPrefix before including this #endif #define sharedbitsPrefixMakeName(x, y) x ## y -#define sharedbitsPrefixName(Name) sharedbitsPrefixMakeName(sharedbitsPrefix, Name) +#define sharedbitsPrefixExpand(x) x +#define sharedbitsPrefixName(Name) sharedbitsPrefixMakeName(sharedbitsPrefixExpand(sharedbitsPrefix), Name) #undef sharedbitsPrefixName +#undef sharedbitsPrefixExpand #undef sharedbitsPrefixMakeName