Tracepoint c++ support: cast void * to function pointer
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 29 Nov 2011 13:01:50 +0000 (08:01 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 29 Nov 2011 13:01:50 +0000 (08:01 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/tracepoint.h

index 831447dd64643dc754ec0aa6ad9cd39a12ce7d36..709fadc11db744101ca31656cf297b1f51b2de98 100644 (file)
@@ -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);
This page took 0.026794 seconds and 4 git commands to generate.