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