From 4737a11fbb746519bb7cbd040546f799fbfb3a0f Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Sat, 10 Feb 2018 00:31:45 -0500 Subject: [PATCH] Make public headers work with gcc -Wundef 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 | 4 ++-- src/lib/gssapi/generic/gssapi.hin | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/include/krb5/krb5.hin b/src/include/krb5/krb5.hin index c86e782744..55135fc66d 100644 --- a/src/include/krb5/krb5.hin +++ b/src/include/krb5/krb5.hin @@ -106,7 +106,7 @@ 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 diff --git a/src/lib/gssapi/generic/gssapi.hin b/src/lib/gssapi/generic/gssapi.hin index 59cd93e09f..5049fbdf7d 100644 --- a/src/lib/gssapi/generic/gssapi.hin +++ b/src/lib/gssapi/generic/gssapi.hin @@ -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 -- 2.47.2