]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Make public headers work with gcc -Wundef 726/head
authorGreg Hudson <ghudson@mit.edu>
Sat, 10 Feb 2018 05:31:45 +0000 (00:31 -0500)
committerGreg Hudson <ghudson@mit.edu>
Wed, 14 Feb 2018 16:53:16 +0000 (11:53 -0500)
The C standard allows undefined symbols in #if statements, giving them
the value 0 (C99 section 6.10.1).  However, some software builds with
gcc -Wundef, which issues a warning on undefined symbols in
preprocessor expressions.  Make the public headers safe for that
environment by using #ifdef instead of #if for TARGET_OS_MAC.
Reported by Ben Kaduk.

ticket: 8641 (new)

src/include/krb5/krb5.hin
src/lib/gssapi/generic/gssapi.hin

index c86e78274484d3c9f90198a500448d64aee08642..55135fc66df4e32c77307998596dd8b27ab28577 100644 (file)
 
 KRB5INT_BEGIN_DECLS
 
-#if TARGET_OS_MAC
+#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
 #    pragma pack(push,2)
 #endif
 
@@ -8481,7 +8481,7 @@ krb5_set_kdc_recv_hook(krb5_context context, krb5_post_recv_fn recv_hook,
                        void *data);
 
 
-#if TARGET_OS_MAC
+#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
 #    pragma pack(pop)
 #endif
 
index 59cd93e09f92963fcf5468be4ae4fb196fe9e859..5049fbdf7daec74b9e9701bbd6b33ff0773a630c 100644 (file)
@@ -39,7 +39,7 @@
 extern "C" {
 #endif /* __cplusplus */
 
-#if TARGET_OS_MAC
+#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
 #    pragma pack(push,2)
 #endif
 
@@ -816,7 +816,7 @@ gss_set_neg_mechs(
     gss_cred_id_t,      /* cred_handle */
     const gss_OID_set); /* mech_set */
 
-#if TARGET_OS_MAC
+#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
 #    pragma pack(pop)
 #endif