Update for MacOS-X and garbage collection.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4402 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1999-06-14 09:07:52 +00:00
parent 2e5303ee74
commit 4a6fe0c764
6 changed files with 407 additions and 317 deletions

View file

@ -58,8 +58,8 @@
// Allocating and Initializing
- (id) initValue: (const void *)value
withObjCType: (const char *)type
- (id) initWithBytes: (const void *)value
objCType: (const char *)type
{
typedef _dt = data;
self = [super init];
@ -198,17 +198,20 @@
// NSCoding
- (void) encodeWithCoder: (NSCoder *)coder
{
const char *type;
[super encodeWithCoder: coder];
type = [self objCType];
[coder encodeValueOfObjCType: @encode(char *) at: &type];
[coder encodeValueOfObjCType: type at: &data];
#if TYPE_ORDER == 0
[NSException raise: NSInternalInconsistencyException
format: @"Attempt to encode a non-retained object"];
#elif TYPE_ORDER == 2
[NSException raise: NSInternalInconsistencyException
format: @"Attempt to encode a pointer to void object"];
#else
[coder encodeValueOfObjCType: @encode(TYPE_NAME) at: &data];
#endif
}
- (id) initWithCoder: (NSCoder *)coder
{
[NSException raise: NSInconsistentArchiveException
format: @"Cannot unarchive class - Need NSValueDecoder."];
[coder decodeValueOfObjCType: @encode(TYPE_NAME) at: &data];
return self;
}