From: Mathieu Desnoyers Date: Tue, 29 Nov 2011 13:01:50 +0000 (-0500) Subject: Tracepoint c++ support: cast void * to function pointer X-Git-Tag: v1.9.1~53 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=93ffe3667d076b908015a1e00ce7285da41bf658;p=lttng-ust.git Tracepoint c++ support: cast void * to function pointer Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/tracepoint.h b/include/lttng/tracepoint.h index 831447dd..709fadc1 100644 --- a/include/lttng/tracepoint.h +++ b/include/lttng/tracepoint.h @@ -182,10 +182,14 @@ static void __attribute__((constructor)) __tracepoints__init(void) liblttngust_handle = dlopen("liblttng-ust.so", RTLD_NOW | RTLD_GLOBAL); if (!liblttngust_handle) return; - tracepoint_register_lib = dlsym(liblttngust_handle, - "tracepoint_register_lib"); - tracepoint_unregister_lib = dlsym(liblttngust_handle, - "tracepoint_unregister_lib"); + tracepoint_register_lib = + URCU_FORCE_CAST(int (*)(struct tracepoint * const *, int), + dlsym(liblttngust_handle, + "tracepoint_register_lib")); + tracepoint_unregister_lib = + URCU_FORCE_CAST(int (*)(struct tracepoint * const *), + dlsym(liblttngust_handle, + "tracepoint_unregister_lib")); tracepoint_register_lib(__start___tracepoints_ptrs, __stop___tracepoints_ptrs - __start___tracepoints_ptrs);