diff options
Diffstat (limited to 'Source/CTest/Curl/ldap.c')
-rw-r--r-- | Source/CTest/Curl/ldap.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/Source/CTest/Curl/ldap.c b/Source/CTest/Curl/ldap.c index 5e26e4b..fb4bb79 100644 --- a/Source/CTest/Curl/ldap.c +++ b/Source/CTest/Curl/ldap.c @@ -54,11 +54,14 @@ #include <curl/mprintf.h> -#define DYNA_GET_FUNCTION(type, fnc) \ - (fnc) = (type)DynaGetFunction(#fnc); \ - if ((fnc) == NULL) { \ - return CURLE_FUNCTION_NOT_FOUND; \ - } \ +#define DYNA_GET_FUNCTION(type, fnc) \ + { \ + void* dyna_get_res = DynaGetFunction(#fnc); \ + (fnc) = *((type)&dyna_get_res); \ + if ((fnc) == NULL) { \ + return CURLE_FUNCTION_NOT_FOUND; \ + } \ + } /*********************************************************************** */ @@ -163,15 +166,15 @@ CURLcode Curl_ldap(struct connectdata *conn) /* The types are needed because ANSI C distinguishes between * pointer-to-object (data) and pointer-to-function. */ - DYNA_GET_FUNCTION(void *(*)(char *, int), ldap_open); - DYNA_GET_FUNCTION(int (*)(void *, char *, char *), ldap_simple_bind_s); - DYNA_GET_FUNCTION(int (*)(void *), ldap_unbind_s); - DYNA_GET_FUNCTION(int (*)(void *, char *, int, void **), ldap_url_search_s); - DYNA_GET_FUNCTION(void *(*)(void *, void *), ldap_first_entry); - DYNA_GET_FUNCTION(void *(*)(void *, void *), ldap_next_entry); - DYNA_GET_FUNCTION(char *(*)(int), ldap_err2string); - DYNA_GET_FUNCTION(int (*)(void *, char *, void *, void *, char **, char **, int (*)(void *, char *, int), void *, char *, int, unsigned long), ldap_entry2text); - DYNA_GET_FUNCTION(int (*)(void *, char *, void *, void *, char **, char **, int (*)(void *, char *, int), void *, char *, int, unsigned long, char *, char *), ldap_entry2html); + DYNA_GET_FUNCTION(void *(**)(char *, int), ldap_open); + DYNA_GET_FUNCTION(int (**)(void *, char *, char *), ldap_simple_bind_s); + DYNA_GET_FUNCTION(int (**)(void *), ldap_unbind_s); + DYNA_GET_FUNCTION(int (**)(void *, char *, int, void **), ldap_url_search_s); + DYNA_GET_FUNCTION(void *(**)(void *, void *), ldap_first_entry); + DYNA_GET_FUNCTION(void *(**)(void *, void *), ldap_next_entry); + DYNA_GET_FUNCTION(char *(**)(int), ldap_err2string); + DYNA_GET_FUNCTION(int (**)(void *, char *, void *, void *, char **, char **, int (*)(void *, char *, int), void *, char *, int, unsigned long), ldap_entry2text); + DYNA_GET_FUNCTION(int (**)(void *, char *, void *, void *, char **, char **, int (*)(void *, char *, int), void *, char *, int, unsigned long, char *, char *), ldap_entry2html); server = ldap_open(conn->hostname, conn->port); if (server == NULL) { |