]> git.sesse.net Git - vlc/commitdiff
override: simplify CALL()
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 16 Feb 2011 21:24:59 +0000 (23:24 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 16 Feb 2011 21:25:28 +0000 (23:25 +0200)
bin/override.c

index 2c94afe4f437242c4a4896deccddf8a82841b557..705bb836072b5b91f9736401fd45c7a54e0084be 100644 (file)
@@ -109,32 +109,12 @@ 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,
- *  nested function...
+ *  statement-expression
  */
 #define CALL(func, ...) \
-({ \
-    static typeof (func) *sym = NULL; \
-    static pthread_once_t once = PTHREAD_ONCE_INIT; \
-    auto void getsym_once (void); \
-    void getsym_once (void) \
-    { \
-        sym = getsym ( # func); \
-    } \
-    pthread_once (&once, getsym_once); \
-    sym (__VA_ARGS__); \
-})
-
-#endif
+({ typeof (func) *sym = getsym ( # func); sym (__VA_ARGS__); })
 
 /*** Environment ***
  *