]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
boringssl + schannel: undef X509_NAME in lib/schannel.h
authorGisle Vanem <gisle.vanem@gmail.com>
Fri, 8 Jun 2018 13:10:05 +0000 (15:10 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 8 Jun 2018 21:25:17 +0000 (23:25 +0200)
Fixes the build problem when both boringssl and schannel are enabled.

Fixes #2634
Closes #2643

lib/ldap.c
lib/vtls/schannel.h

index 89047bcbdaa8e217acbfc3b20d019f54c5dce43d..4d8f4fa2883a940533714b684647a653e51a4fc9 100644 (file)
 # endif /* HAVE_LDAP_SSL && HAVE_LDAP_SSL_H */
 #endif
 
-/* These are macros in both <wincrypt.h> (in above <winldap.h>) and typedefs
- * in BoringSSL's <openssl/x509.h>
- */
-#ifdef HAVE_BORINGSSL
-# undef X509_NAME
-# undef X509_CERT_PAIR
-# undef X509_EXTENSIONS
-#endif
-
 #include "urldata.h"
 #include <curl/curl.h>
 #include "sendf.h"
index aa44e8e89b424a23454b8513a04945ad629c96be..51417affe1ac0affffc3b68ddd8fde05c9f3c05b 100644 (file)
 
 #include "urldata.h"
 
+/* <wincrypt.h> has been included via the above <schnlsp.h>.
+ * Or in case of ldap.c, it was included via <winldap.h>.
+ * And since <wincrypt.h> has this:
+ *   #define X509_NAME  ((LPCSTR) 7)
+ *
+ * And in BoringSSL's <openssl/base.h> there is:
+ *  typedef struct X509_name_st X509_NAME;
+ *  etc.
+ *
+ * this wil cause all kinds of C-preprocessing paste errors in
+ * BoringSSL's <openssl/x509.h>: So just undefine those defines here
+ * (and only here).
+ */
+#if defined(HAVE_BORINGSSL) || defined(OPENSSL_IS_BORINGSSL)
+# undef X509_NAME
+# undef X509_CERT_PAIR
+# undef X509_EXTENSIONS
+#endif
+
 extern const struct Curl_ssl Curl_ssl_schannel;
 
 CURLcode verify_certificate(struct connectdata *conn, int sockindex);