mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-01 02:30:24 +01:00
mesa: silence void * / func * conversion warnings
This commit is contained in:
parent
d1f76b1d85
commit
e22e65d223
1 changed files with 10 additions and 5 deletions
|
|
@ -67,22 +67,27 @@ _mesa_dlopen(const char *libname, int flags)
|
|||
GenericFunc
|
||||
_mesa_dlsym(void *handle, const char *fname)
|
||||
{
|
||||
union {
|
||||
void *v;
|
||||
GenericFunc f;
|
||||
} u;
|
||||
#if defined(__blrts)
|
||||
return (GenericFunc) NULL;
|
||||
u.v = NULL;
|
||||
#elif defined(__DJGPP__)
|
||||
/* need '_' prefix on symbol names */
|
||||
char fname2[1000];
|
||||
fname2[0] = '_';
|
||||
strncpy(fname2 + 1, fname, 998);
|
||||
fname2[999] = 0;
|
||||
return (GenericFunc) dlsym(handle, fname2);
|
||||
u.v = dlsym(handle, fname2);
|
||||
#elif defined(_GNU_SOURCE)
|
||||
return (GenericFunc) dlsym(handle, fname);
|
||||
u.v = dlsym(handle, fname);
|
||||
#elif defined(__MINGW32__)
|
||||
return (GenericFunc) GetProcAddress(handle, fname);
|
||||
u.v = (void *) GetProcAddress(handle, fname);
|
||||
#else
|
||||
return (GenericFunc) NULL;
|
||||
u.v = NULL;
|
||||
#endif
|
||||
return u.f;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue