summaryrefslogtreecommitdiff
path: root/gcc/objc/Object.m
diff options
context:
space:
mode:
authorkrab <krab@138bc75d-0d04-0410-961f-82ee72b054a4>1993-09-22 18:00:23 +0000
committerkrab <krab@138bc75d-0d04-0410-961f-82ee72b054a4>1993-09-22 18:00:23 +0000
commitb78b9a5fea6f0a29cad57131e87602bf047e83e1 (patch)
tree2292c1c01010fcde35f6c597c878ee33bb5ffd67 /gcc/objc/Object.m
parent07de056ecc618faf59fa5b3abdb7569501d6a4e2 (diff)
downloadgcc-b78b9a5fea6f0a29cad57131e87602bf047e83e1.tar.gz
(-compare:, -shouldNotImplement:): Added.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@5399 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/objc/Object.m')
-rw-r--r--gcc/objc/Object.m18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/objc/Object.m b/gcc/objc/Object.m
index 166bff4533f..622dcbe64c3 100644
--- a/gcc/objc/Object.m
+++ b/gcc/objc/Object.m
@@ -116,6 +116,18 @@ extern int errno;
return self==anObject;
}
+- (int)compare:anotherObject;
+{
+ if ([self isEqual:anotherObject])
+ return 0;
+ // Ordering objects by their address is pretty useless,
+ // so subclasses should override this is some useful way.
+ else if (self > anotherObject)
+ return 1;
+ else
+ return -1;
+}
+
- (BOOL)isMetaClass
{
return NO;
@@ -287,6 +299,12 @@ extern int errno;
return [self error:"method %s not implemented", sel_get_name(aSel)];
}
+- shouldNotImplement:(SEL)aSel
+{
+ return [self error:"%s should not implement %s",
+ object_get_class_name(self), sel_get_name(aSel)];
+}
+
- doesNotRecognize:(SEL)aSel
{
return [self error:"%s does not recognize %s",