summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>2009-09-13 13:09:47 +0100
committerM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>2009-09-13 20:27:41 +0300
commitfee5c58c6caecdbdb387fe39bd6ed94faf7f6ae9 (patch)
treedc4fa9bf6d7d16a3cc1080686d06699bf9f8cc67
parent19881012cb31ec2aebf556e2c25b53e8387dc689 (diff)
[trace] Avoid warnings from assigning a void pointer to a function pointer.
The Sun Studio compiler complains a *lot* when assigning the result of dlsym to a function pointer. Cast the result to the proper type first.:w
-rw-r--r--util/cairo-trace/trace.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c
index 5a1f9082..c826ea2e 100644
--- a/util/cairo-trace/trace.c
+++ b/util/cairo-trace/trace.c
@@ -87,10 +87,10 @@ static void *_dlhandle = RTLD_NEXT;
#define DLCALL(name, args...) ({ \
static typeof (&name) name##_real; \
if (name##_real == NULL) { \
- name##_real = dlsym (_dlhandle, #name); \
+ name##_real = (typeof (&name))(dlsym (_dlhandle, #name)); \
if (name##_real == NULL && _dlhandle == RTLD_NEXT) { \
_dlhandle = dlopen ("libcairo.so", RTLD_LAZY); \
- name##_real = dlsym (_dlhandle, #name); \
+ name##_real = (typeof (&name))(dlsym (_dlhandle, #name)); \
assert (name##_real != NULL); \
} \
} \