]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Harmonize struct packing for gic_opt.c 407/head
authorTom Yu <tlyu@mit.edu>
Wed, 17 Feb 2016 20:58:24 +0000 (15:58 -0500)
committerTom Yu <tlyu@mit.edu>
Wed, 17 Feb 2016 23:19:33 +0000 (18:19 -0500)
struct extended_options in gic_opt.c extends krb5_get_init_creds_opt.
On Mac OS X, for historical reasons, we define krb5_get_init_creds_opt
with an alignment/packing of 2, conflicting with the compiler default.
This results in alignment change warnings from clang on Mac OS X.
Ensure that extended_options has the same packing.

src/lib/krb5/krb/gic_opt.c

index 4d4e46bd5bc3b025d53be9dae6e80676b91878cf..d4b8918aa926b5345be209274491a05a1760328b 100644 (file)
@@ -8,6 +8,14 @@
 
 #define DEFAULT_FLAGS KRB5_GET_INIT_CREDS_OPT_CHG_PWD_PRMPT
 
+#if defined(__MACH__) && defined(__APPLE__)
+#include <TargetConditionals.h>
+#endif
+
+/* Match struct packing of krb5_get_init_creds_opt on MacOS X. */
+#if TARGET_OS_MAC
+#pragma pack(push,2)
+#endif
 struct extended_options {
     krb5_get_init_creds_opt opt;
     int num_preauth_data;
@@ -21,6 +29,9 @@ struct extended_options {
     krb5_responder_fn responder;
     void *responder_data;
 };
+#if TARGET_OS_MAC
+#pragma pack(pop)
+#endif
 
 void KRB5_CALLCONV
 krb5_get_init_creds_opt_init(krb5_get_init_creds_opt *opt)