mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
Joe Halpin fixed the warning on the typecast from data pointer to function
pointer!
This commit is contained in:
parent
3f21fe60fc
commit
6bdcfecbcf
@ -164,7 +164,11 @@ static dynafunc DynaGetFunction(const char *name)
|
||||
|
||||
#if defined(HAVE_DLOPEN) || defined(HAVE_LIBDL)
|
||||
if (libldap) {
|
||||
func = (dynafunc)dlsym(libldap, name);
|
||||
/* This typecast magic below was brought by Joe Halpin. In ISO C, you
|
||||
* cannot typecast a data pointer to a function pointer, but that's
|
||||
* exactly what we need to do here to avoid compiler warnings on picky
|
||||
* compilers! */
|
||||
*(void**) (&func) = dlsym(libldap, name);
|
||||
}
|
||||
#elif defined(WIN32)
|
||||
if (libldap) {
|
||||
|
Loading…
Reference in New Issue
Block a user