v01-0001-approach-01-Reorder-openssl-header.patch

application/octet-stream

Filename: v01-0001-approach-01-Reorder-openssl-header.patch
Type: application/octet-stream
Part: 0
Message: Re: Windows: openssl & gssapi dislike each other

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
Series: patch v1-0001
File+
src/include/libpq/libpq-be.h 11 4
diff --git a/src/include/libpq/libpq-be.h b/src/include/libpq/libpq-be.h
index 05cb1874c5..3601fba92f 100644
--- a/src/include/libpq/libpq-be.h
+++ b/src/include/libpq/libpq-be.h
@@ -19,10 +19,6 @@
 #define LIBPQ_BE_H
 
 #include <sys/time.h>
-#ifdef USE_OPENSSL
-#include <openssl/ssl.h>
-#include <openssl/err.h>
-#endif
 #include <netinet/tcp.h>
 
 #ifdef ENABLE_GSS
@@ -57,6 +53,17 @@ typedef struct
 #include "libpq/hba.h"
 #include "libpq/pqcomm.h"
 
+/*
+ * These SSL-related #includes must come after all system-provided headers.
+ * This ensures that OpenSSL can take care of conflicts with Windows'
+ * <wincrypt.h> by #undef'ing the conflicting macros.  (We don't directly
+ * include <wincrypt.h>, but some other Windows headers do.) Here <gssapi/gssapi.h>
+ * indirectly inlcudes <wincrypt.h> which cause conflicting macros. 
+ */
+#ifdef USE_OPENSSL
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+#endif
 
 /*
  * GSSAPI specific state information