projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mesa: Clean up header file inclusion in cpuinfo.c.
[mesa.git]
/
src
/
mesa
/
main
/
dlopen.c
diff --git
a/src/mesa/main/dlopen.c
b/src/mesa/main/dlopen.c
index 81e032081db451e69167d33f580ccf63e5f8f0e3..57a33292ed169aba5105e83069a0f3ccf5b67ade 100644
(file)
--- a/
src/mesa/main/dlopen.c
+++ b/
src/mesa/main/dlopen.c
@@
-67,22
+67,27
@@
_mesa_dlopen(const char *libname, int flags)
GenericFunc
_mesa_dlsym(void *handle, const char *fname)
{
GenericFunc
_mesa_dlsym(void *handle, const char *fname)
{
+ union {
+ void *v;
+ GenericFunc f;
+ } u;
#if defined(__blrts)
#if defined(__blrts)
-
return (GenericFunc)
NULL;
+
u.v =
NULL;
#elif defined(__DJGPP__)
/* need '_' prefix on symbol names */
char fname2[1000];
fname2[0] = '_';
#elif defined(__DJGPP__)
/* need '_' prefix on symbol names */
char fname2[1000];
fname2[0] = '_';
-
_mesa_
strncpy(fname2 + 1, fname, 998);
+ strncpy(fname2 + 1, fname, 998);
fname2[999] = 0;
fname2[999] = 0;
-
return (GenericFunc)
dlsym(handle, fname2);
+
u.v =
dlsym(handle, fname2);
#elif defined(_GNU_SOURCE)
#elif defined(_GNU_SOURCE)
-
return (GenericFunc)
dlsym(handle, fname);
+
u.v =
dlsym(handle, fname);
#elif defined(__MINGW32__)
#elif defined(__MINGW32__)
-
return (GenericFunc
) GetProcAddress(handle, fname);
+
u.v = (void *
) GetProcAddress(handle, fname);
#else
#else
-
return (GenericFunc)
NULL;
+
u.v =
NULL;
#endif
#endif
+ return u.f;
}
}