diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/wrapper/verbose.h | 13 | ||||
-rw-r--r-- | src/wrapper/wrapper.c | 5 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/wrapper/verbose.h b/src/wrapper/verbose.h index 06ee681..00f72a0 100644 --- a/src/wrapper/verbose.h +++ b/src/wrapper/verbose.h @@ -1,11 +1,11 @@ #pragma once -#ifdef VERBOSE_FUNCTIONS -# include <stdio.h> -# include <stdarg.h> -# include <pthread.h> +#include <stdio.h> +#include <stdarg.h> +#include <pthread.h> + static void -verbose(const char *fmt, ...) +verbose_log(const char *fmt, ...) { static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_lock(&mutex); @@ -17,6 +17,9 @@ verbose(const char *fmt, ...) fputc('\n', stderr); pthread_mutex_unlock(&mutex); } + +#ifdef VERBOSE_FUNCTIONS +# define verbose verbose_log #else # define verbose(...) #endif diff --git a/src/wrapper/wrapper.c b/src/wrapper/wrapper.c index 44e0802..d7feff5 100644 --- a/src/wrapper/wrapper.c +++ b/src/wrapper/wrapper.c @@ -61,6 +61,11 @@ wrapper_create(const char *const symbol, void *function) { assert(symbol); + if (!function) { + verbose_log("FIXME: unimplemented symbol: %s", symbol); + return NULL; + } + #ifdef WRAPPER_TRACE if (!__cxa_demangle.ptr) __cxa_demangle.ptr = dlsym(RTLD_DEFAULT, "__cxa_demangle"); |