bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Patch/base](HEAD) GSObjCSuper


From: David Ayers
Subject: [Patch/base](HEAD) GSObjCSuper
Date: Wed, 10 Sep 2003 11:28:23 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4b) Gecko/20030507

       * Headers/Additions/GNUstepBase/GSObjCRuntime.h (GSObjCSuper):
       Added test for uninitialized superclass reference.

Commited to HEAD.
(And will commit to the branch if no one objects.)

I'm not certain though, whether we want to commit the previos patch:
2003-08-24  David Ayers  <d dot ayers at inode dot at>

       * Headers/Additions/GNUstepBase/GSObjCRuntime.h
       (GSObjCClass):  Allow nil values.
       (GSObjCIsInstance): Ditto.
       (GSObjCIsClass): New function.
       (GSClassNameFromObject): Ditto.
       (GSObjCIsKindOf):  Use GSObjCSuper() in favor of
       class_get_super_class().

       ...

(plus some other GSObjCRuntime usage followups that are already part of HEAD) to the branch, as we might have some subtle implicit semantic changes, but I think the should be minimal and only have effect for people dealing with MetaClasses and such.

If we want them on the branch, I can commit them.

Cheers,
David

Index: Headers/Additions/GNUstepBase/GSObjCRuntime.h
===================================================================
RCS file: 
/cvsroot/gnustep/gnustep/core/base/Headers/Additions/GNUstepBase/GSObjCRuntime.h,v
retrieving revision 1.2
diff -u -r1.2 GSObjCRuntime.h
--- Headers/Additions/GNUstepBase/GSObjCRuntime.h       24 Aug 2003 23:07:40 
-0000      1.2
+++ Headers/Additions/GNUstepBase/GSObjCRuntime.h       10 Sep 2003 09:05:37 
-0000
@@ -139,9 +139,21 @@
  * Returns the superclass of this.
  */
 GS_STATIC_INLINE Class
-GSObjCSuper(Class this)
+GSObjCSuper(Class class)
 {
-  return class_get_super_class(this);
+#ifndef NeXT_RUNTIME
+  if (class != 0 && CLS_ISRESOLV (class) == NO)
+    {
+      const char *name;
+      name = (const char *)class->super_class;
+      if (name == NULL)
+       {
+         return 0;
+       }
+      return objc_lookup_class (name);
+    }
+#endif
+  return class_get_super_class(class);
 }
 
 /**


reply via email to

[Prev in Thread] Current Thread [Next in Thread]