aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGisle Vanem <gvanem@broadpark.no>2004-12-17 17:54:21 +0000
committerGisle Vanem <gvanem@broadpark.no>2004-12-17 17:54:21 +0000
commit41e776f9db72e08de4eeebed22420deb8421e6af (patch)
tree4093320be973360ffacfa0fb954630ef4cf63a04
parent5c2d4a6bddbf83dec07afbb7991816e520d6c099 (diff)
Fix calling convention of wlap32.dll function. Watcom
uses fastcall by default, so force cdecl.
-rw-r--r--lib/ldap.c31
1 files changed, 16 insertions, 15 deletions
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) {