use objc_alognof_type()

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@15149 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2002-11-27 17:31:38 +00:00
parent 32f7a6bc8b
commit 52ca7410dc
2 changed files with 6 additions and 3 deletions

View file

@ -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 <rfm@gnu.org>

View file

@ -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 "<name>=" 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.