From 41e776f9db72e08de4eeebed22420deb8421e6af Mon Sep 17 00:00:00 2001 From: Gisle Vanem Date: Fri, 17 Dec 2004 17:54:21 +0000 Subject: Fix calling convention of wlap32.dll function. Watcom uses fastcall by default, so force cdecl. --- lib/ldap.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'lib') diff --git a/lib/ldap.c b/lib/ldap.c index 5646baee8..104268892 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -68,7 +68,8 @@ #include "memdebug.h" /* WLdap32.dll functions are *not* stdcall. Must call these via __cdecl - * pointers in case libcurl was compiled as fastcall (-Gr). + * pointers in case libcurl was compiled as fastcall (cl -Gr). Watcom + * uses fastcall by default. */ #if !defined(WIN32) && !defined(__cdecl) #define __cdecl @@ -265,25 +266,25 @@ 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_init); - DYNA_GET_FUNCTION(int (*)(void *, char *, char *), ldap_simple_bind_s); - DYNA_GET_FUNCTION(int (*)(void *), ldap_unbind_s); + DYNA_GET_FUNCTION(void *(__cdecl *)(char *, int), ldap_init); + DYNA_GET_FUNCTION(int (__cdecl *)(void *, char *, char *), ldap_simple_bind_s); + DYNA_GET_FUNCTION(int (__cdecl *)(void *), ldap_unbind_s); #ifndef WIN32 DYNA_GET_FUNCTION(int (*)(char *, LDAPURLDesc **), ldap_url_parse); DYNA_GET_FUNCTION(void (*)(void *), ldap_free_urldesc); #endif - DYNA_GET_FUNCTION(int (*)(void *, char *, int, char *, char **, int, + DYNA_GET_FUNCTION(int (__cdecl *)(void *, char *, int, char *, char **, int, void **), ldap_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(char *(*)(void *, void *), ldap_get_dn); - DYNA_GET_FUNCTION(char *(*)(void *, void *, void **), ldap_first_attribute); - DYNA_GET_FUNCTION(char *(*)(void *, void *, void *), ldap_next_attribute); - DYNA_GET_FUNCTION(char **(*)(void *, void *, const char *), ldap_get_values); - DYNA_GET_FUNCTION(void (*)(char **), ldap_value_free); - DYNA_GET_FUNCTION(void (*)(void *), ldap_memfree); - DYNA_GET_FUNCTION(void (*)(void *, int), ber_free); + DYNA_GET_FUNCTION(void *(__cdecl *)(void *, void *), ldap_first_entry); + DYNA_GET_FUNCTION(void *(__cdecl *)(void *, void *), ldap_next_entry); + DYNA_GET_FUNCTION(char *(__cdecl *)(int), ldap_err2string); + DYNA_GET_FUNCTION(char *(__cdecl *)(void *, void *), ldap_get_dn); + DYNA_GET_FUNCTION(char *(__cdecl *)(void *, void *, void **), ldap_first_attribute); + DYNA_GET_FUNCTION(char *(__cdecl *)(void *, void *, void *), ldap_next_attribute); + DYNA_GET_FUNCTION(char **(__cdecl *)(void *, void *, const char *), ldap_get_values); + DYNA_GET_FUNCTION(void (__cdecl *)(char **), ldap_value_free); + DYNA_GET_FUNCTION(void (__cdecl *)(void *), ldap_memfree); + DYNA_GET_FUNCTION(void (__cdecl *)(void *, int), ber_free); server = (*ldap_init)(conn->host.name, (int)conn->port); if (server == NULL) { -- cgit v1.2.3