]> git.sesse.net Git - vlc/commitdiff
Provide a variant of the CALL macro which doesn't use the nested functions GNU C...
authorJai Menon <jmenon86@gmail.com>
Sun, 9 Jan 2011 17:36:54 +0000 (11:36 -0600)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 9 Jan 2011 18:33:15 +0000 (20:33 +0200)
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>
bin/override.c

index ac9e14cddd5bf98be6ad55e8726dc007a53868fd..2c94afe4f437242c4a4896deccddf8a82841b557 100644 (file)
@@ -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 ***
  *