]> ruderich.org/simon Gitweb - coloredstderr/coloredstderr.git/blobdiff - src/ldpreload.h
ldpreload.h: Add missing unlikely() in DLSYM_FUNCTION().
[coloredstderr/coloredstderr.git] / src / ldpreload.h
index 6ef291185981a44c90a484df71efe635460e7b03..792679bb91d4fbf26ec17c18b239aa2e91f08979 100644 (file)
@@ -30,6 +30,7 @@
 #include <dlfcn.h>
 #include <errno.h>
 
+static void *dlsym_function(char const *name) noinline;
 /* Load the function name using dlsym() and return it. Terminate program on
  * failure. Split in function and macro to reduce code inserted into the
  * function using the macro. */
@@ -52,7 +53,7 @@ static void *dlsym_function(char const *name) {
 }
 
 #define DLSYM_FUNCTION(pointer, name) \
-    if (!(pointer)) { \
+    if (unlikely(!(pointer))) { \
         *(void **) (&(pointer)) = dlsym_function(name); \
     }