]> git.sesse.net Git - vlc/blobdiff - bin/override.c
Contrib: fix upnp compilation on win64
[vlc] / bin / override.c
index 0828f00717f528a8d1553be6f26b519aef7a632d..b216dfeda00106d40fea1bf4f5cfc627dad7d23a 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * override.c: overriden function calls for VLC media player
+ * override.c: overridden function calls for VLC media player
  *****************************************************************************
  * Copyright (C) 2010 RĂ©mi Denis-Courmont
  *
@@ -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 ***
  *
@@ -264,26 +244,8 @@ error:
 #endif
 
 
-/*** Dynaminc linker ***/
-
-void *dlopen (const char *path, int flags)
-{
-    if (override && path != NULL)
-    {
-        /* Work around the KDE SIGCHLD and KDE D-Bus exit handler bugs */
-        if (strstr (path, "libkde") != NULL)
-        {
-            LOG("Blocked", "\"%s\", %d", path, flags);
-            return NULL;
-        }
-    }
-    return CALL(dlopen, path, flags);
-}
-
-
-/*** Locales ***/
-
-/* setlocale() is not thread-safe and has a tendency to crash other threads as
+/*** Locales ***
+ * setlocale() is not thread-safe and has a tendency to crash other threads as
  * quite many libc and libintl calls depend on the locale.
  * Use uselocale() instead for thread-safety.
  */