Harden be-gssapi-common.h for headerscheck
authorAlvaro Herrera <[email protected]>
Fri, 26 Nov 2021 20:00:29 +0000 (17:00 -0300)
committerAlvaro Herrera <[email protected]>
Fri, 26 Nov 2021 20:00:29 +0000 (17:00 -0300)
Surround the contents with a test that the feature is enabled by
configure, to silence header checking tools on systems without GSSAPI
installed.

Backpatch to 12, where the file appeared.

Discussion: https://postgr.es/m/202111161709[email protected]

src/include/libpq/be-gssapi-common.h

index 441bae57d92bcf78a0791a257e00b4b2ff158609..86976670153b4ae575362a219ab4fc788295b55a 100644 (file)
@@ -14,6 +14,8 @@
 #ifndef BE_GSSAPI_COMMON_H
 #define BE_GSSAPI_COMMON_H
 
+#ifdef ENABLE_GSS
+
 #if defined(HAVE_GSSAPI_H)
 #include <gssapi.h>
 #else
@@ -23,4 +25,6 @@
 extern void pg_GSS_error(const char *errmsg,
                         OM_uint32 maj_stat, OM_uint32 min_stat);
 
+#endif                         /* ENABLE_GSS */
+
 #endif                         /* BE_GSSAPI_COMMON_H */