krb5 commit: Harmonize macOS pack declarations with Heimdal

Greg Hudson <[email protected]>
Newsgroups gmane.comp.encryption.kerberos.cvs
Message-ID <[email protected]>
https://github.com/krb5/krb5/commit/d177b5d70bf575c498bfdd3abb6a6413646ad7c5
commit d177b5d70bf575c498bfdd3abb6a6413646ad7c5
Author: Greg Hudson <[email protected]>
Date:   Tue Sep 1 00:33:42 2020 -0400

    Harmonize macOS pack declarations with Heimdal
    
    Replace the TARGET_OS_MAC conditionals with the conditionals used in
    Heimdal, so that we do not pack structures inconsistently with macOS
    on ARM.  Suggested by Luke Howard.
    
    ticket: 8944 (new)

 src/include/CredentialsCache.h    |    4 ++--
 src/include/CredentialsCache2.h   |    4 ++--
 src/include/krb5/krb5.hin         |    8 ++++----
 src/lib/gssapi/generic/gssapi.hin |    8 ++++----
 src/lib/krb5/krb/gic_opt.c        |    4 ++--
 5 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/include/CredentialsCache.h b/src/include/CredentialsCache.h
index c181596..1c20f9d 100644
--- a/src/include/CredentialsCache.h
+++ b/src/include/CredentialsCache.h
@@ -52,7 +52,7 @@
 extern "C" {
 #endif /* __cplusplus */
 
-#if TARGET_OS_MAC
+#if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))
 #pragma pack(push,2)
 #endif
 
@@ -1518,7 +1518,7 @@ CCACHE_API cc_int32 cc_initialize (cc_context_t  *out_context,
     ((iterator) -> functions -> clone (iterator, new_iterator))
 /*!@}*/
 
-#if TARGET_OS_MAC
+#if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))
 #pragma pack(pop)
 #endif
 
diff --git a/src/include/CredentialsCache2.h b/src/include/CredentialsCache2.h
index 9e5a346..8a5871b 100644
--- a/src/include/CredentialsCache2.h
+++ b/src/include/CredentialsCache2.h
@@ -50,7 +50,7 @@
 extern "C" {
 #endif /* __cplusplus */
 
-#if TARGET_OS_MAC
+#if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))
 #pragma pack(push,2)
 #endif
 
@@ -291,7 +291,7 @@ cc_lock_request (apiCB          *in_context,
                  const cc_int32  in_lock_type)
     CCAPI_DEPRECATED;
 
-#if TARGET_OS_MAC
+#if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))
 #pragma pack(pop)
 #endif
 
diff --git a/src/include/krb5/krb5.hin b/src/include/krb5/krb5.hin
index 114ab19..9927d2f 100644
--- a/src/include/krb5/krb5.hin
+++ b/src/include/krb5/krb5.hin
@@ -106,8 +106,8 @@
 
 KRB5INT_BEGIN_DECLS
 
-#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
-#    pragma pack(push,2)
+#if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))
+#pragma pack(push,2)
 #endif
 
 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 30203
@@ -8552,8 +8552,8 @@ void KRB5_CALLCONV
 krb5_set_kdc_recv_hook(krb5_context context, krb5_post_recv_fn recv_hook,
                        void *data);
 
-#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
-#    pragma pack(pop)
+#if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))
+#pragma pack(pop)
 #endif
 
 KRB5INT_END_DECLS
diff --git a/src/lib/gssapi/generic/gssapi.hin b/src/lib/gssapi/generic/gssapi.hin
index 5049fbd..767fb07 100644
--- a/src/lib/gssapi/generic/gssapi.hin
+++ b/src/lib/gssapi/generic/gssapi.hin
@@ -39,8 +39,8 @@
 extern "C" {
 #endif /* __cplusplus */
 
-#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
-#    pragma pack(push,2)
+#if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))
+#pragma pack(push,2)
 #endif
 
 #if defined(_MSDOS) || defined(_WIN32)
@@ -816,8 +816,8 @@ gss_set_neg_mechs(
     gss_cred_id_t,      /* cred_handle */
     const gss_OID_set); /* mech_set */
 
-#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
-#    pragma pack(pop)
+#if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))
+#pragma pack(pop)
 #endif
 
 #ifdef __cplusplus
diff --git a/src/lib/krb5/krb/gic_opt.c b/src/lib/krb5/krb/gic_opt.c
index ccbe1a6..11f0b71 100644
--- a/src/lib/krb5/krb/gic_opt.c
+++ b/src/lib/krb5/krb/gic_opt.c
@@ -13,7 +13,7 @@
 #endif
 
 /* Match struct packing of krb5_get_init_creds_opt on macOS. */
-#if TARGET_OS_MAC
+#if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))
 #pragma pack(push,2)
 #endif
 struct extended_options {
@@ -30,7 +30,7 @@ struct extended_options {
     void *responder_data;
     int pac_request;            /* -1 unset, 0 false, 1 true */
 };
-#if TARGET_OS_MAC
+#if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))
 #pragma pack(pop)
 #endif
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.