]> rtime.felk.cvut.cz Git - fpga/lx-cpu1/gcc-tumbl.git/commitdiff
In libobjc/:
authornicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 15 Dec 2010 19:47:18 +0000 (19:47 +0000)
committernicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 15 Dec 2010 19:47:18 +0000 (19:47 +0000)
2010-12-15  Nicola Pero  <nicola.pero@meta-innovation.com>

* objc/message.h (objc_super): When using the modern API, do not
define Super and Super_t, and always use 'super_class' for the
super class field.
(objc_msg_lookup_super): Updated prototype to use 'struct
objc_super *' instead of 'Super_t'.
* sendmsg.c (objc_msg_lookup_super): Updated prototype to use
'struct objc_super *' instead of 'Super_t'.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167869 138bc75d-0d04-0410-961f-82ee72b054a4

libobjc/ChangeLog
libobjc/objc/message.h
libobjc/sendmsg.c

index bfcda715e76ffbb13cd695571cbbec081d29f182..a636c8ba4efca21318aa820c1d6ffd28435f0c29 100644 (file)
@@ -1,3 +1,13 @@
+2010-12-15  Nicola Pero  <nicola.pero@meta-innovation.com>
+
+       * objc/message.h (objc_super): When using the modern API, do not
+       define Super and Super_t, and always use 'super_class' for the
+       super class field.      
+       (objc_msg_lookup_super): Updated prototype to use 'struct
+       objc_super *' instead of 'Super_t'.
+       * sendmsg.c (objc_msg_lookup_super): Updated prototype to use
+       'struct objc_super *' instead of 'Super_t'.
+
 2010-12-15  Nicola Pero  <nicola.pero@meta-innovation.com>
 
        * objc/message.h: Update comments, reindented code and moved
index 3eda27e1d2abe96ec245d4d04239acdf8d008d2a..66f0160c1e856b05d9399c1dd7a79fa582672751 100644 (file)
@@ -91,25 +91,40 @@ objc_EXPORT IMP objc_msg_lookup (id receiver, SEL op);
 /* Structure used when a message is send to a class's super class.
    The compiler generates one of these structures and passes it to
    objc_msg_lookup_super() when a [super method] call is compiled.  */
+
+/* In the traditional API, the super class field is called 'class' in
+   Objective-C and 'super_class' in Objective-C++.  In the new API
+   (objc/runtime.h) it is always called 'super_class'.  We detect the
+   "traditional API" by the fact that the objc/objc-api.h header
+   include guards are defined, which means objc/objc-api.h has been
+   included.  This works because objc/message.h does not exist in the
+   Traditional API and is only read because objc-api.h itself includes
+   it.  */
+#ifdef __objc_api_INCLUDE_GNU
+/* Traditional API.  */
 typedef struct objc_super
 {
   id    self;       /* Id of the object sending the message. */
-
-  /* The new version of the API will always use 'super_class'.  TODO:
-     Use class only if objc-api.h is included, otherwise always use
-     super_class.  */
 #ifdef __cplusplus
   Class super_class;
 #else
   Class class;        /* Object's super class. */
 #endif
 } Super, *Super_t;
+#else
+/* Modern API.  */
+struct objc_super
+{
+  id    self;        /* The receiver of the message.  */
+  Class super_class; /* The superclass of the receiver.  */
+};
+#endif
 
 /* This is used by the compiler instead of objc_msg_lookup () when
    compiling a call to 'super', such as [super method].  This requires
    sending a message to super->self, but looking up the method as if
    super->self was in class super->super_class.  */
-objc_EXPORT IMP objc_msg_lookup_super (Super_t super, SEL sel);
+objc_EXPORT IMP objc_msg_lookup_super (struct objc_super *super, SEL sel);
 
 /* Hooks for method forwarding.  They make it easy to substitute the
    built-in forwarding with one based on a library, such as ffi, that
index 48605fc67f81bdc368935daa3627a96dc623558b..07452cceb798dba302e7de64f0d321635cc73321 100644 (file)
@@ -445,7 +445,7 @@ objc_msg_lookup (id receiver, SEL op)
 }
 
 IMP
-objc_msg_lookup_super (Super_t super, SEL sel)
+objc_msg_lookup_super (struct objc_super *super, SEL sel)
 {
   if (super->self)
     return get_imp (super->class, sel);