mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
old/new objc api updates
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33027 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ac3f2c5095
commit
b2649e0526
16 changed files with 62 additions and 18 deletions
|
@ -66,7 +66,13 @@ typeSize(const char* type)
|
|||
case _C_BFLD:
|
||||
case _C_ARY_B:
|
||||
case _C_UNION_B:
|
||||
case _C_STRUCT_B: return objc_sizeof_type(type);
|
||||
case _C_STRUCT_B:
|
||||
{
|
||||
NSUInteger size;
|
||||
|
||||
NSGetSizeAndAlignment(type, &size, 0);
|
||||
return (int)size;
|
||||
}
|
||||
case _C_VOID: return 0;
|
||||
default: return -1;
|
||||
}
|
||||
|
@ -242,13 +248,15 @@ typeSize(const char* type)
|
|||
|
||||
- (void) encodeWithCoder: (NSCoder *)coder
|
||||
{
|
||||
NSUInteger tsize;
|
||||
unsigned size;
|
||||
NSMutableData *d;
|
||||
|
||||
size = strlen(objctype)+1;
|
||||
[coder encodeValueOfObjCType: @encode(unsigned) at: &size];
|
||||
[coder encodeArrayOfObjCType: @encode(signed char) count: size at: objctype];
|
||||
size = objc_sizeof_type(objctype);
|
||||
NSGetSizeAndAlignment(objctype, 0, &tsize);
|
||||
size = tsize;
|
||||
d = [NSMutableData new];
|
||||
[d serializeDataAt: data ofObjCType: objctype context: nil];
|
||||
size = [d length];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue