diff options
author | nicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-19 01:29:09 +0000 |
---|---|---|
committer | nicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-19 01:29:09 +0000 |
commit | 69cfe70ff09adc0bea3e12abca3633cbe444e98b (patch) | |
tree | 462247c43c060a7636dfaee091ca5f760c1a6231 /libobjc | |
parent | aad58106aca82ec0858551f5402446be8bc383d5 (diff) | |
download | gcc-69cfe70ff09adc0bea3e12abca3633cbe444e98b.tar.gz |
In gcc/testsuite/:
2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/gnu-api-2-resolve-method.m: Include objc/message.h.
* obj-c++.dg/gnu-api-2-resolve-method.m: Include objc/message.h.
In libobjc/:
2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com>
* Makefile.in (OBJC_DEPRECATED_H): Added objc_msg_sendv.h.
* objc/deprecated/objc_msg_sendv.h: New.
* objc/message.h: Do not define retval_t, apply_t, arglist,
arglist_t, objc_msg_sendv, now in
objc/deprecated/objc_msg_sendv.h.
* objc/objc.h: Do not include message.h; include
objc/deprecated/objc_msg_sendv.h instead. Tidied up comments.
* sendmsg.c: Include objc/message.h.
* thr.c: Include objc/message.h.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168042 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libobjc')
-rw-r--r-- | libobjc/ChangeLog | 12 | ||||
-rw-r--r-- | libobjc/Makefile.in | 1 | ||||
-rw-r--r-- | libobjc/objc/deprecated/objc_msg_sendv.h | 12 | ||||
-rw-r--r-- | libobjc/objc/message.h | 14 | ||||
-rw-r--r-- | libobjc/objc/objc.h | 80 | ||||
-rw-r--r-- | libobjc/sendmsg.c | 1 | ||||
-rw-r--r-- | libobjc/thr.c | 1 |
7 files changed, 63 insertions, 58 deletions
diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog index 2dea497a95e..dd0769029c8 100644 --- a/libobjc/ChangeLog +++ b/libobjc/ChangeLog @@ -1,5 +1,17 @@ 2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com> + * Makefile.in (OBJC_DEPRECATED_H): Added objc_msg_sendv.h. + * objc/deprecated/objc_msg_sendv.h: New. + * objc/message.h: Do not define retval_t, apply_t, arglist, + arglist_t, objc_msg_sendv, now in + objc/deprecated/objc_msg_sendv.h. + * objc/objc.h: Do not include message.h; include + objc/deprecated/objc_msg_sendv.h instead. Tidied up comments. + * sendmsg.c: Include objc/message.h. + * thr.c: Include objc/message.h. + +2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com> + * objc/objc-exception.h: Include objc-decls.h. Mark all functions with objc_EXPORT. * objc/objc-sync.h: Same change. diff --git a/libobjc/Makefile.in b/libobjc/Makefile.in index 0040511bf61..c519542e072 100644 --- a/libobjc/Makefile.in +++ b/libobjc/Makefile.in @@ -142,6 +142,7 @@ OBJC_DEPRECATED_H = \ objc_error.h \ objc_get_uninstalled_dtable.h \ objc_malloc.h \ + objc_msg_sendv.h \ objc_object_alloc.h \ objc_unexpected_exception.h \ objc_valloc.h \ diff --git a/libobjc/objc/deprecated/objc_msg_sendv.h b/libobjc/objc/deprecated/objc_msg_sendv.h new file mode 100644 index 00000000000..825d9a76612 --- /dev/null +++ b/libobjc/objc/deprecated/objc_msg_sendv.h @@ -0,0 +1,12 @@ +/* The following types and functions are provided only for + backwards-compatibility and should not be used in new code. They + were deprecated in GCC 4.6 and will be removed in the next + release. */ +typedef void* retval_t; /* return value */ +typedef void(*apply_t)(void); /* function pointer */ +typedef union arglist { + char *arg_ptr; + char arg_regs[sizeof (char*)]; +} *arglist_t; /* argument frame */ + +objc_EXPORT retval_t objc_msg_sendv(id, SEL, arglist_t); diff --git a/libobjc/objc/message.h b/libobjc/objc/message.h index 66f0160c1e8..9d5e6d8e657 100644 --- a/libobjc/objc/message.h +++ b/libobjc/objc/message.h @@ -137,20 +137,6 @@ objc_EXPORT IMP objc_msg_lookup_super (struct objc_super *super, SEL sel); objc_EXPORT IMP (*__objc_msg_forward)(SEL); objc_EXPORT IMP (*__objc_msg_forward2)(id, SEL); - -/* The following types and functions are provided only for - backwards-compatibility and should not be used in new code. They - were deprecated in GCC 4.6 and will be removed in the next - release. */ -typedef void* retval_t; /* return value */ -typedef void(*apply_t)(void); /* function pointer */ -typedef union arglist { - char *arg_ptr; - char arg_regs[sizeof (char*)]; -} *arglist_t; /* argument frame */ - -objc_EXPORT retval_t objc_msg_sendv(id, SEL, arglist_t); - #ifdef __cplusplus } #endif diff --git a/libobjc/objc/objc.h b/libobjc/objc/objc.h index 7d382169dfb..ece0f884105 100644 --- a/libobjc/objc/objc.h +++ b/libobjc/objc/objc.h @@ -28,8 +28,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see /* This file contains the definition of the basic types used by the Objective-C language. It needs to be included to do almost - anything with Objective-C. -*/ + anything with Objective-C. */ #ifdef __cplusplus extern "C" { @@ -37,25 +36,27 @@ extern "C" { #include <stddef.h> +/* objc-decls.h is included because deprecated/objc_msg_sendv.h needs + it. When that goes away, the include of objc-decls.h should be + removed. */ +#include "objc-decls.h" + /* The current version of the GNU Objective-C Runtime library in compressed ISO date format. This should be updated any time a new version is released with changes to the public API (there is no need to update it if there were no API changes since the previous release). This macro is only defined starting with the GNU Objective-C Runtime shipped with GCC 4.6.0. If it is not defined, - it is either an older version of the runtime, or another runtime. -*/ + it is either an older version of the runtime, or another runtime. */ #define __GNU_LIBOBJC__ 20100911 -/* - Definition of the boolean type. +/* Definition of the boolean type. - Compatibility note: the Apple/NeXT runtime defines a BOOL as a - 'signed char'. The GNU runtime uses an 'unsigned char'. + Compatibility note: the Apple/NeXT runtime defines a BOOL as a + 'signed char'. The GNU runtime uses an 'unsigned char'. - Important: this could change and we could switch to 'typedef bool - BOOL' in the future. Do not depend on the type of BOOL. -*/ + Important: this could change and we could switch to 'typedef bool + BOOL' in the future. Do not depend on the type of BOOL. */ #undef BOOL typedef unsigned char BOOL; @@ -65,8 +66,7 @@ typedef unsigned char BOOL; /* The basic Objective-C types (SEL, Class, id) are defined as pointer to opaque structures. The details of the structures are private to the runtime and may potentially change from one version to the - other. -*/ + other. */ /* A SEL (selector) represents an abstract method (in the object-oriented sense) and includes all the details of how to @@ -74,16 +74,14 @@ typedef unsigned char BOOL; types) but provides no implementation of its own. You can check whether a class implements a selector or not, and if you have a selector and know that the class implements it, you can use it to - call the method for an object in the class. - */ + call the method for an object in the class. */ typedef const struct objc_selector *SEL; #include "deprecated/struct_objc_selector.h" /* A Class is a class (in the object-oriented sense). In Objective-C there is the complication that each Class is an object itself, and so belongs to a class too. This class that a class belongs to is - called its 'meta class'. -*/ + called its 'meta class'. */ typedef struct objc_class *Class; #include "deprecated/MetaClass.h" #include "deprecated/struct_objc_class.h" @@ -91,32 +89,29 @@ typedef struct objc_class *Class; /* An 'id' is an object of an unknown class. The way the object data is stored inside the object is private and what you see here is only the beginning of the actual struct. The first field is always - a pointer to the Class that the object belongs to. -*/ + a pointer to the Class that the object belongs to. */ typedef struct objc_object { /* 'class_pointer' is the Class that the object belongs to. In case of a Class object, this pointer points to the meta class. Compatibility Note: The Apple/NeXT runtime calls this field - 'isa'. To access this field in a portable way, use - object_getClass() from runtime.h, which is an inline function so - does not add any overhead. */ + 'isa'. To access this field, use object_getClass() from + runtime.h, which is an inline function so does not add any + overhead and is also portable to other runtimes. */ Class class_pointer; } *id; -/* - 'IMP' is a C function that implements a method. When retrieving the - implementation of a method from the runtime, this is the type of the - pointer returned. The idea of the definition of IMP is to represent - a 'pointer to a general function taking an id, a SEL, followed by - other unspecified arguments'. You must always cast an IMP to a - pointer to a function taking the appropriate, specific types for - that function, before calling it - to make sure the appropriate - arguments are passed to it. The code generated by the compiler to - perform method calls automatically does this cast inside method - calls. -*/ +/* 'IMP' is a C function that implements a method. When retrieving + the implementation of a method from the runtime, this is the type + of the pointer returned. The idea of the definition of IMP is to + represent a 'pointer to a general function taking an id, a SEL, + followed by other unspecified arguments'. You must always cast an + IMP to a pointer to a function taking the appropriate, specific + types for that function, before calling it - to make sure the + appropriate arguments are passed to it. The code generated by the + compiler to perform method calls automatically does this cast + inside method calls. */ typedef id (*IMP)(id, SEL, ...); /* 'nil' is the null object. Messages to nil do nothing and always @@ -135,21 +130,18 @@ typedef id (*IMP)(id, SEL, ...); /* TODO: Move the 'Protocol' declaration into objc/runtime.h. A Protocol is simply an object, not a basic Objective-C type. The Apple runtime defines Protocol in objc/runtime.h too, so it's good - to move it there for API compatibility. -*/ + to move it there for API compatibility. */ /* A 'Protocol' is a formally defined list of selectors (normally created using the @protocol Objective-C syntax). It is mostly used at compile-time to check that classes implement all the methods that they are supposed to. Protocols are also available in the - runtime system as Protocol objects. - */ + runtime system as Protocol objects. */ #ifndef __OBJC__ /* Once we stop including the deprecated struct_objc_protocol.h there is no reason to even define a 'struct objc_protocol'. As all the structure details will be hidden, a Protocol basically is - simply an object (as it should be). - */ + simply an object (as it should be). */ /* typedef struct objc_object Protocol; */ #include "deprecated/struct_objc_protocol.h" #else /* __OBJC__ */ @@ -158,8 +150,9 @@ typedef id (*IMP)(id, SEL, ...); /* Deprecated include - here temporarily, for backwards-compatibility as reval_t, apply_t, arglist_t and objc_msg_lookup() used to be - defined here. */ -#include "message.h" + defined here. objc_msg_lookup() is now defined in message.h, + included by objc-api.h or runtime.h. */ +#include "deprecated/objc_msg_sendv.h" /* Compatibility note: the Apple/NeXT runtime defines sel_getName(), sel_registerName(), object_getClassName(), object_getIndexedIvars() @@ -167,8 +160,7 @@ typedef id (*IMP)(id, SEL, ...); The reason the GNU runtime does not define them here is that they are not basic Objective-C types (defined in this file), but are - part of the runtime API (defined in runtime.h). -*/ + part of the runtime API (defined in runtime.h). */ #ifdef __cplusplus } diff --git a/libobjc/sendmsg.c b/libobjc/sendmsg.c index 8797c82c981..e41a190eb37 100644 --- a/libobjc/sendmsg.c +++ b/libobjc/sendmsg.c @@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "coretypes.h" #include "tm.h" #include "objc/runtime.h" +#include "objc/message.h" /* For objc_msg_lookup(), objc_msg_lookup_super(). */ #include "objc/thr.h" #include "objc-private/module-abi-8.h" #include "objc-private/runtime.h" diff --git a/libobjc/thr.c b/libobjc/thr.c index b1fde3db920..3f7e5c525fa 100644 --- a/libobjc/thr.c +++ b/libobjc/thr.c @@ -38,6 +38,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "tm.h" #include "defaults.h" #include "objc/thr.h" +#include "objc/message.h" /* For objc_msg_lookup(). */ #include "objc/runtime.h" #include "objc-private/runtime.h" #include <gthr.h> |