File tree Expand file tree Collapse file tree 5 files changed +46
-30
lines changed
Expand file tree Collapse file tree 5 files changed +46
-30
lines changed Original file line number Diff line number Diff line change 1919#include "miscadmin.h"
2020#include "utils/builtins.h"
2121
22- /*
23- * On Windows, <wincrypt.h> includes a #define for X509_NAME, which breaks our
24- * ability to use OpenSSL's version of that symbol if <wincrypt.h> is pulled
25- * in after <openssl/ssl.h> ... and, at least on some builds, it is. We
26- * can't reliably fix that by re-ordering #includes, because libpq/libpq-be.h
27- * #includes <openssl/ssl.h>. Instead, just zap the #define again here.
28- */
29- #ifdef X509_NAME
30- #undef X509_NAME
31- #endif
32-
3322PG_MODULE_MAGIC ;
3423
3524static Datum X509_NAME_field_to_text (X509_NAME * name , text * fieldName );
Original file line number Diff line number Diff line change 1616
1717#ifdef ENABLE_GSS
1818
19- #if defined(HAVE_GSSAPI_H )
20- #include <gssapi.h>
21- #include <gssapi_ext.h>
22- #else
23- #include <gssapi/gssapi.h>
24- #include <gssapi/gssapi_ext.h>
25- #endif
19+ #include "libpq/pg-gssapi.h"
2620
2721extern void pg_GSS_error (const char * errmsg ,
2822 OM_uint32 maj_stat , OM_uint32 min_stat );
Original file line number Diff line number Diff line change 2828#include <netinet/tcp.h>
2929
3030#ifdef ENABLE_GSS
31- #if defined(HAVE_GSSAPI_H )
32- #include <gssapi.h>
33- #else
34- #include <gssapi/gssapi.h>
35- #endif /* HAVE_GSSAPI_H */
31+ #include "libpq/pg-gssapi.h"
3632#endif /* ENABLE_GSS */
3733
3834#ifdef ENABLE_SSPI
Original file line number Diff line number Diff line change 1+ /*-------------------------------------------------------------------------
2+ *
3+ * pg-gssapi.h
4+ * Definitions for including GSSAPI headers
5+ *
6+ * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
7+ * Portions Copyright (c) 1994, Regents of the University of California
8+ *
9+ * src/include/libpq/pg-gssapi.h
10+ *
11+ *-------------------------------------------------------------------------
12+ */
13+
14+ #ifndef PG_GSSAPI_H
15+ #define PG_GSSAPI_H
16+
17+ #ifdef ENABLE_GSS
18+
19+ /* IWYU pragma: begin_exports */
20+ #if defined(HAVE_GSSAPI_H )
21+ #include <gssapi.h>
22+ #include <gssapi_ext.h>
23+ #else
24+ #include <gssapi/gssapi.h>
25+ #include <gssapi/gssapi_ext.h>
26+ #endif
27+ /* IWYU pragma: end_exports */
28+
29+ /*
30+ * On Windows, <wincrypt.h> includes a #define for X509_NAME, which breaks our
31+ * ability to use OpenSSL's version of that symbol if <wincrypt.h> is pulled
32+ * in after <openssl/ssl.h> ... and, at least on some builds, it is. We
33+ * can't reliably fix that by re-ordering #includes, because libpq/libpq-be.h
34+ * #includes <openssl/ssl.h>. Instead, just zap the #define again here.
35+ */
36+ #ifdef X509_NAME
37+ #undef X509_NAME
38+ #endif
39+
40+ #endif /* ENABLE_GSS */
41+
42+ #endif /* PG_GSSAPI_H */
43+
Original file line number Diff line number Diff line change 4444#include "fe-auth-sasl.h"
4545#include "pqexpbuffer.h"
4646
47- /* IWYU pragma: begin_exports */
4847#ifdef ENABLE_GSS
49- #if defined(HAVE_GSSAPI_H )
50- #include <gssapi.h>
51- #else
52- #include <gssapi/gssapi.h>
53- #endif
48+ #include "libpq/pg-gssapi.h"
5449#endif
55- /* IWYU pragma: end_exports */
5650
5751#ifdef ENABLE_SSPI
5852#define SECURITY_WIN32
You can’t perform that action at this time.
0 commit comments