From 70215de5d288c036bf93316177f3420bd02c313e Mon Sep 17 00:00:00 2001 From: CaS Date: Wed, 27 Nov 2002 17:31:38 +0000 Subject: [PATCH] use objc_alognof_type() git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@15149 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 3 +++ Source/mframe.m | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index d13d05acd..0a0536dd5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,9 @@ windoze. * Source/NSArray.m: Write non-xml property lists as ascii. * Source/NSDictionary.m: Write non-xml property lists as ascii. + * Source/mframe.m: use objc_alignof_type() as suggested by Roland + Schwingel. Long ago the objc runtime version was buggy so mframe + implemented its own algorithm. Now the objc runtime one is better. 2002-11-26 Richard Frith-Macdonald diff --git a/Source/mframe.m b/Source/mframe.m index 0741cb52e..693b3beff 100644 --- a/Source/mframe.m +++ b/Source/mframe.m @@ -359,9 +359,9 @@ mframe_next_arg(const char *typePtr, NSArgumentInfo *info) case _C_STRUCT_B: { - struct { int x; double y; } fooalign; int acc_size = 0; - int acc_align = __alignof__(fooalign); + int def_align = objc_alignof_type(typePtr-1); + int acc_align = def_align; /* * Skip "=" stuff. @@ -385,7 +385,7 @@ mframe_next_arg(const char *typePtr, NSArgumentInfo *info) } acc_size = ROUND(acc_size, local.align); acc_size += local.size; - acc_align = MAX(local.align, __alignof__(fooalign)); + acc_align = MAX(local.align, def_align); } /* * Continue accumulating structure size.