Index: generic/nsfInt.h =================================================================== diff -u -r453ad27418d60f0ab744ae4ac911bcd5e2505140 -r714726da8aa70930a6f1f482e48ab98e4af0b88b --- generic/nsfInt.h (.../nsfInt.h) (revision 453ad27418d60f0ab744ae4ac911bcd5e2505140) +++ generic/nsfInt.h (.../nsfInt.h) (revision 714726da8aa70930a6f1f482e48ab98e4af0b88b) @@ -334,20 +334,25 @@ /* The NsfConfigEnabled() macro allows for querying whether a - configuration macro (see above) is actually defined (and whether it - expands to 1). This macro can be used both in CPP expressions (e.g., - "#if NsfConfigEnabled(...)") and in C expressions (e.g., - "if(NsfConfigEnabled(...))") - - Adapted from https://plus.google.com/+LinusTorvalds/posts/9gntjh57dXt + configuration macro (NSF_*; see above) is actually defined (and + whether it expands to 1). This macro can be used both in CPP + expressions (e.g., "#if NsfConfigEnabled(...)") and in C expressions + (e.g., "if(NsfConfigEnabled(...))") */ -#define NsfConfigEnabled(macro) NsfConfigEnabled_(macro) -#define NsfMacroTest_1 , -#define NsfConfigEnabled_(value) NsfConfigEnabled__(NsfMacroTest_##value) -#define NsfConfigEnabled__(comma) NsfConfigEnabled___(comma 1, 0) -#define NsfConfigEnabled___(_, v, ...) v +#define NsfConfigEnabled__NOOP(...) +#define NsfConfigEnabled__open ( +#define NsfConfigEnabled__close ) +#define NsfConfigEnabled__caller(macro, args) macro args +#define NsfConfigEnabled__helper_1 NsfConfigEnabled__close NsfConfigEnabled__open 1 +#define NsfConfigEnabled__(x) (NsfConfigEnabled__caller(NsfConfigEnabled__NOOP, \ + NsfConfigEnabled__open \ + NsfConfigEnabled__helper_##x \ + NsfConfigEnabled__close) + 0) +#define NsfConfigEnabled_(x) NsfConfigEnabled__(x) +#define NsfConfigEnabled(x) NsfConfigEnabled_(NSF_##x) + /* * * Next Scripting Structures