Browse Source

Provide a variant of the CALL macro which doesn't use the nested functions GNU C extension.

This is useful when building with compilers like clang+llvm which do not
plan on implementing this extension.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
pull/2/head
Jai Menon 15 years ago
committed by Rémi Denis-Courmont
parent
commit
0dff66f4f6
  1. 8
      bin/override.c

8
bin/override.c

@ -109,6 +109,13 @@ static void *getsym (const char *name)
logbug(&counter, level, __func__, __VA_ARGS__); \
} while (0)
#ifdef __clang__
#define CALL(func, ...) \
({ typeof (func) *sym = getsym ( # func); sym (__VA_ARGS__); })
#else
/* Evil non-standard GNU C macro ;)
* typeof keyword,
* statement-expression,
@ -127,6 +134,7 @@ static void *getsym (const char *name)
sym (__VA_ARGS__); \
})
#endif
/*** Environment ***
*

Loading…
Cancel
Save