summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2015-01-26 11:55:58 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2015-03-26 10:15:04 +0100
commit14218d7d6b9524e4f7854c27bab8b5fdf3b4e88a (patch)
treef08ea338baf6c17439d9fa6cc43d14c47264efcd
parentedac1b36b572cbd8988c44341185a9f51ea3eeb5 (diff)
ssl_verify: Move wincrypt.h related #ifdef closer to the include
Both wincrypt.h and openssl try to define X509_NAME. The wincrypt.h one is not useful for us, so we currently #undef it if this was set. However, it's done very late, right before including x509v3.h which defines the X509_NAME type. Any header included in between may try to #include x509v3.h so it's better to undefine X509_NAME right after including wincrypt.h.
-rw-r--r--common/ssl_verify.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/common/ssl_verify.h b/common/ssl_verify.h
index e4a0406..e32ca54 100644
--- a/common/ssl_verify.h
+++ b/common/ssl_verify.h
@@ -22,6 +22,10 @@
#if defined(WIN32)
#include <windows.h>
#include <wincrypt.h>
+#ifdef X509_NAME
+/* wincrypt.h has already a different define... */
+#undef X509_NAME
+#endif
#endif
#include <openssl/rsa.h>
@@ -29,10 +33,6 @@
#include <openssl/x509.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
-#ifdef X509_NAME
-/* wincrypt.h has already a different define... */
-#undef X509_NAME
-#endif
#include <openssl/x509v3.h>
#include <spice/macros.h>