v01-0001-approach03-undefine-macro-before-ssl-includes.patch
application/octet-stream
Filename: v01-0001-approach03-undefine-macro-before-ssl-includes.patch
Type: application/octet-stream
Part: 2
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/backend/libpq/be-secure-openssl.c | 9 | 4 |
diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c index 39b1a66236..d77e6af7dd 100644 --- a/src/backend/libpq/be-secure-openssl.c +++ b/src/backend/libpq/be-secure-openssl.c @@ -38,11 +38,16 @@ #include "utils/memutils.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.) + * On Windows, <wincrypt.h> includes a #define for X509_NAME, which breaks our + * ability to use OpenSSL's version of that symbol if <wincrypt.h> is pulled + * in after <openssl/ssl.h> (which is being done here as "libpq/libpq.h" indirectly + * includes <wincrypt.h> when gssapi is enabled). We can't reliably fix that by + * re-ordering includes. Instead, just zap the #define again here. */ +#ifdef X509_NAME +#undef X509_NAME +#endif + #include "common/openssl.h" #include <openssl/conf.h> #include <openssl/dh.h>