From 8cfc936f5c9d1fe9a99956a916f95e137476b27c Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 5 Mar 2023 19:55:14 +0000 Subject: cmake: fix enabling LDAPS on Windows Before this patch, enabling LDAPS required a manual C flag: https://github.com/curl/curl-for-win/blob/c1cfc31cfc04f24f7a4f946564d6f0e1b4d7dd36/curl-cmake.sh#L105 Fix this and enable LDAPS automatically when using `wldap32` (and when not explicitly disabled). This matches autotools and `Makefile.mk` behavior. Also remove issue from KNOWN_BUGS. Add workaround for MSVS 2010 warning triggered by LDAPS now enabled in more CI tests: `ldap.c(360): warning C4306: 'type cast' : conversion from 'int' to 'void *' of greater size` Ref: https://ci.appveyor.com/project/curlorg/curl/builds/46408284/job/v8mwl9yfbmoeqwlr#L312 Reported-by: JackBoosY on github Reviewed-by: Jay Satiro Reviewed-by: Marcel Raad Fixes #6284 Closes #10674 --- lib/ldap.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/ldap.c') diff --git a/lib/ldap.c b/lib/ldap.c index 5e53f4c51..595e4b3b3 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -140,6 +140,14 @@ static void _ldap_free_urldesc(LDAPURLDesc *ludp); #define ldap_err2string ldap_err2stringA #endif +#if defined(USE_WIN32_LDAP) && defined(_MSC_VER) && (_MSC_VER <= 1600) +/* Workaround for warning: + 'type cast' : conversion from 'int' to 'void *' of greater size */ +#undef LDAP_OPT_ON +#undef LDAP_OPT_OFF +#define LDAP_OPT_ON ((void *)(size_t)1) +#define LDAP_OPT_OFF ((void *)(size_t)0) +#endif static CURLcode ldap_do(struct Curl_easy *data, bool *done); -- cgit v1.2.1