From 93ffe3667d076b908015a1e00ce7285da41bf658 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 29 Nov 2011 08:01:50 -0500 Subject: [PATCH] Tracepoint c++ support: cast void * to function pointer Signed-off-by: Mathieu Desnoyers --- include/lttng/tracepoint.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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); -- 2.34.1