[vlc-commits] commit: Provide a variant of the CALL macro which	doesn' t use the nested functions GNU C extension. (Jai Menon )
    git at videolan.org 
    git at videolan.org
       
    Sun Jan  9 19:33:20 CET 2011
    
    
  
vlc | branch: master | Jai Menon <jmenon86 at gmail.com> | Sun Jan  9 11:36:54 2011 -0600| [0dff66f4f61964e4e8ffdb2bcbe6dd197958292b] | committer: Rémi Denis-Courmont 
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 at remlab.net>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0dff66f4f61964e4e8ffdb2bcbe6dd197958292b
---
 bin/override.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/bin/override.c b/bin/override.c
index ac9e14c..2c94afe 100644
--- a/bin/override.c
+++ b/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 ***
  *
    
    
More information about the vlc-commits
mailing list