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.