From: Greg Hudson Date: Sat, 10 Feb 2018 05:31:45 +0000 (-0500) Subject: Make public headers work with gcc -Wundef X-Git-Tag: krb5-1.17-beta1~186 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4737a11fbb746519bb7cbd040546f799fbfb3a0f;p=thirdparty%2Fkrb5.git 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) --- 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