diff options
author | nicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-12 16:17:18 +0000 |
---|---|---|
committer | nicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-12 16:17:18 +0000 |
commit | 6ee7a2767f6f0b31bae9ad13066cf9d36663882f (patch) | |
tree | 7e29a3f7298da78a7ec2df063e05a796f6ceb968 /libobjc | |
parent | d8bc803082928434d39c7ab25b322f7066603de6 (diff) | |
download | gcc-6ee7a2767f6f0b31bae9ad13066cf9d36663882f.tar.gz |
2010-10-12 Nicola Pero <nicola.pero@meta-innovation.com>
* archive.c: Do not include objc/objc.h.
* class.c: Do not include objc/objc.h.
* encoding.c: Include objc/runtime.h, ctype.h and
objc-private/module-abi-8.h instead of objc/objc-api.h and
objc/encoding.h.
* error.c: Do not include objc/objc.h.
* gc.c: Include tconfig.h and objc/encoding.h only if
OBJC_WITH_GC.
* hash.c: Include objc/runtime.h and objc/thr.h instead of
objc/objc-api.h. Do not include objc/objc.h.
* init.c: Do not include objc/objc.h.
* ivars.c: Include objc/runtime.h, objc-private/module-abi-8.h and
objc/thr.h instead of objc/objc-api.h. Do not include
objc/objc.h.
* linking.m: Tidied comment.
* memory.c: Include objc/runtime.h instead of objc/objc-api.h.
Do not include objc/objc.h.
* objects.c: Do not include objc/objc.h.
* objc-sync.c: Include objc/runtime.h instead of objc/objc-api.h.
* protocols.c: Do not include objc/objc.h.
* sarray.c: Include objc/runtime.h instead of objc/objc-api.h. Do
not include objc/objc.h.
* selector.c: Do not include objc/objc.h.
* sendmsg.c: Do not include objc/objc.h.
* thr.c: Include objc/runtime.h instead of objc/objc-api.h.
Do not include objc/objc.h.
* objc/objc-decls.h: Reindented code.
* objc/runtime.h Include objc-decls.h. Updated comments.
(objc_malloc): New.
(objc_atomic_malloc): New.
(objc_calloc): New.
(objc_realloc): New.
(objc_free): New.
* objc-private/runtime.h: Updated comments.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165386 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libobjc')
-rw-r--r-- | libobjc/ChangeLog | 37 | ||||
-rw-r--r-- | libobjc/archive.c | 1 | ||||
-rw-r--r-- | libobjc/class.c | 1 | ||||
-rw-r--r-- | libobjc/encoding.c | 5 | ||||
-rw-r--r-- | libobjc/error.c | 3 | ||||
-rw-r--r-- | libobjc/gc.c | 8 | ||||
-rw-r--r-- | libobjc/hash.c | 4 | ||||
-rw-r--r-- | libobjc/init.c | 1 | ||||
-rw-r--r-- | libobjc/ivars.c | 5 | ||||
-rw-r--r-- | libobjc/linking.m | 3 | ||||
-rw-r--r-- | libobjc/memory.c | 3 | ||||
-rw-r--r-- | libobjc/objc-private/runtime.h | 3 | ||||
-rw-r--r-- | libobjc/objc-sync.c | 2 | ||||
-rw-r--r-- | libobjc/objc/objc-decls.h | 14 | ||||
-rw-r--r-- | libobjc/objc/runtime.h | 30 | ||||
-rw-r--r-- | libobjc/objects.c | 1 | ||||
-rw-r--r-- | libobjc/protocols.c | 1 | ||||
-rw-r--r-- | libobjc/sarray.c | 5 | ||||
-rw-r--r-- | libobjc/selector.c | 1 | ||||
-rw-r--r-- | libobjc/sendmsg.c | 1 | ||||
-rw-r--r-- | libobjc/thr.c | 3 |
21 files changed, 94 insertions, 38 deletions
diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog index 569d6a69c3a..78467d86d47 100644 --- a/libobjc/ChangeLog +++ b/libobjc/ChangeLog @@ -1,5 +1,42 @@ 2010-10-12 Nicola Pero <nicola.pero@meta-innovation.com> + * archive.c: Do not include objc/objc.h. + * class.c: Do not include objc/objc.h. + * encoding.c: Include objc/runtime.h, ctype.h and + objc-private/module-abi-8.h instead of objc/objc-api.h and + objc/encoding.h. + * error.c: Do not include objc/objc.h. + * gc.c: Include tconfig.h and objc/encoding.h only if + OBJC_WITH_GC. + * hash.c: Include objc/runtime.h and objc/thr.h instead of + objc/objc-api.h. Do not include objc/objc.h. + * init.c: Do not include objc/objc.h. + * ivars.c: Include objc/runtime.h, objc-private/module-abi-8.h and + objc/thr.h instead of objc/objc-api.h. Do not include + objc/objc.h. + * linking.m: Tidied comment. + * memory.c: Include objc/runtime.h instead of objc/objc-api.h. + Do not include objc/objc.h. + * objects.c: Do not include objc/objc.h. + * objc-sync.c: Include objc/runtime.h instead of objc/objc-api.h. + * protocols.c: Do not include objc/objc.h. + * sarray.c: Include objc/runtime.h instead of objc/objc-api.h. Do + not include objc/objc.h. + * selector.c: Do not include objc/objc.h. + * sendmsg.c: Do not include objc/objc.h. + * thr.c: Include objc/runtime.h instead of objc/objc-api.h. + Do not include objc/objc.h. + * objc/objc-decls.h: Reindented code. + * objc/runtime.h Include objc-decls.h. Updated comments. + (objc_malloc): New. + (objc_atomic_malloc): New. + (objc_calloc): New. + (objc_realloc): New. + (objc_free): New. + * objc-private/runtime.h: Updated comments. + +2010-10-12 Nicola Pero <nicola.pero@meta-innovation.com> + * Makefile.in (C_SOURCE_FILES): Added protocols.c. * objc-private/protocols.h: New. * protocols.c: New. diff --git a/libobjc/archive.c b/libobjc/archive.c index f36f1b748fb..b539ca1163e 100644 --- a/libobjc/archive.c +++ b/libobjc/archive.c @@ -27,7 +27,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "objc-private/common.h" #include "objc-private/error.h" #include "tconfig.h" -#include "objc/objc.h" #include "objc/objc-api.h" #include "objc/hash.h" #include "objc/objc-list.h" diff --git a/libobjc/class.c b/libobjc/class.c index 727b26f4b97..75c933ba32f 100644 --- a/libobjc/class.c +++ b/libobjc/class.c @@ -89,7 +89,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "objc-private/common.h" #include "objc-private/error.h" -#include "objc/objc.h" #include "objc/objc-api.h" #include "objc/thr.h" #include "objc-private/runtime.h" /* the kitchen sink */ diff --git a/libobjc/encoding.c b/libobjc/encoding.c index d417b87396e..87517f4eaf8 100644 --- a/libobjc/encoding.c +++ b/libobjc/encoding.c @@ -36,9 +36,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "tconfig.h" #include "coretypes.h" #include "tm.h" -#include "objc/objc-api.h" -#include "objc/encoding.h" +#include "objc/runtime.h" +#include "objc-private/module-abi-8.h" /* For struct objc_method */ #include <stdlib.h> +#include <ctype.h> #undef MAX #define MAX(X, Y) \ diff --git a/libobjc/error.c b/libobjc/error.c index 0dc8fd8dae0..7c6ba44b76f 100644 --- a/libobjc/error.c +++ b/libobjc/error.c @@ -48,8 +48,7 @@ _objc_abort (const char *fmt, ...) } /* The rest of the file is deprecated. */ -#include "objc/objc.h" -#include "objc/objc-api.h" +#include "objc/objc-api.h" /* For objc_error_handler. */ /* ** Error handler function diff --git a/libobjc/gc.c b/libobjc/gc.c index a67ba1c9855..ed5effbb437 100644 --- a/libobjc/gc.c +++ b/libobjc/gc.c @@ -24,15 +24,15 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ #include "objc-private/common.h" -#include "tconfig.h" #include "objc/objc.h" -#include "objc/encoding.h" +#if OBJC_WITH_GC + +#include "tconfig.h" #include <assert.h> #include <string.h> #include <stdlib.h> - -#if OBJC_WITH_GC +#include "objc/encoding.h" #include <gc.h> #include <limits.h> diff --git a/libobjc/hash.c b/libobjc/hash.c index 602fc84a874..3ecc54a170a 100644 --- a/libobjc/hash.c +++ b/libobjc/hash.c @@ -25,8 +25,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "objc-private/common.h" #include <assert.h> /* For assert */ -#include "objc/objc.h" -#include "objc/objc-api.h" +#include "objc/runtime.h" /* For objc_calloc */ +#include "objc/thr.h" /* Required by objc-private/runtime.h. */ #include "objc-private/hash.h" #include "objc-private/runtime.h" /* for DEBUG_PRINTF */ diff --git a/libobjc/init.c b/libobjc/init.c index 9384f5865c3..0f714c40596 100644 --- a/libobjc/init.c +++ b/libobjc/init.c @@ -26,7 +26,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "objc-private/common.h" #include "objc-private/error.h" -#include "objc/objc.h" #include "objc/objc-api.h" #include "objc/thr.h" #include "objc-private/hash.h" diff --git a/libobjc/ivars.c b/libobjc/ivars.c index 18c6e8af29d..061fa211fa8 100644 --- a/libobjc/ivars.c +++ b/libobjc/ivars.c @@ -23,8 +23,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ #include "objc-private/common.h" -#include "objc/objc.h" -#include "objc/objc-api.h" +#include "objc/runtime.h" +#include "objc-private/module-abi-8.h" /* For runtime structures */ +#include "objc/thr.h" #include "objc-private/runtime.h" /* the kitchen sink */ #include <string.h> /* For strcmp */ diff --git a/libobjc/linking.m b/libobjc/linking.m index 6372e91df45..e94c8ea8c4b 100644 --- a/libobjc/linking.m +++ b/libobjc/linking.m @@ -28,8 +28,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include <objc/NXConstStr.h> /* Generate references to Object and NXConstanstString classes since they are - needed by the runtime system to run correctly. */ - + needed by the runtime system to run correctly. */ void __objc_linking (void) { diff --git a/libobjc/memory.c b/libobjc/memory.c index a0d6e130ad9..458d2566fcb 100644 --- a/libobjc/memory.c +++ b/libobjc/memory.c @@ -42,8 +42,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define __USE_FIXED_PROTOTYPES__ #include <stdlib.h> -#include "objc/objc.h" -#include "objc/objc-api.h" +#include "objc/runtime.h" #if OBJC_WITH_GC #include <gc.h> diff --git a/libobjc/objc-private/runtime.h b/libobjc/objc-private/runtime.h index 3917c3ef3b0..b7e75ae4304 100644 --- a/libobjc/objc-private/runtime.h +++ b/libobjc/objc-private/runtime.h @@ -34,7 +34,8 @@ The original list was: but can almost certainly be shrinked down. -*/ +Note that you can use this file both with objc/objc-api.h and with +objc/runtime.h. */ #ifndef __objc_private_runtime_INCLUDE_GNU #define __objc_private_runtime_INCLUDE_GNU diff --git a/libobjc/objc-sync.c b/libobjc/objc-sync.c index 97349e64029..d01707ca659 100644 --- a/libobjc/objc-sync.c +++ b/libobjc/objc-sync.c @@ -79,7 +79,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "objc-private/common.h" #include "objc/objc-sync.h" /* For objc_sync_enter(), objc_sync_exit() */ -#include "objc/objc-api.h" /* For objc_malloc() */ +#include "objc/runtime.h" /* For objc_malloc() */ #include "objc/thr.h" /* For objc_mutex_loc() and similar */ #include "objc-private/objc-sync.h" /* For __objc_sync_init() */ diff --git a/libobjc/objc/objc-decls.h b/libobjc/objc/objc-decls.h index e5388e33c4c..b3cfb2120f2 100644 --- a/libobjc/objc/objc-decls.h +++ b/libobjc/objc/objc-decls.h @@ -28,13 +28,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if defined (_WIN32) || defined (__WIN32__) || defined (WIN32) -# ifdef DLL_EXPORT /* defined by libtool (if required) */ -# define objc_EXPORT -# define objc_DECLARE -#else -# define objc_EXPORT extern __declspec(dllimport) -# define objc_DECLARE extern __declspec(dllimport) -#endif +# ifdef DLL_EXPORT /* defined by libtool (if required) */ +# define objc_EXPORT +# define objc_DECLARE +# else +# define objc_EXPORT extern __declspec(dllimport) +# define objc_DECLARE extern __declspec(dllimport) +# endif #else diff --git a/libobjc/objc/runtime.h b/libobjc/objc/runtime.h index b5ae87bc7c8..6efe78d6fce 100644 --- a/libobjc/objc/runtime.h +++ b/libobjc/objc/runtime.h @@ -48,6 +48,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see /* TODO: This file is incomplete. */ #include "objc.h" +#include "objc-decls.h" /* An 'Ivar' represents an instance variable. It holds information about the name, type and offset of the instance variable. */ @@ -543,11 +544,38 @@ struct __objcFastEnumerationState */ +/** Implementation: the following functions are in memory.c. */ + +/* Traditional GNU Objective-C Runtime functions that are used for + memory allocation and disposal. These functions are used in the + same way as you use malloc, realloc, calloc and free and make sure + that memory allocation works properly with the garbage + collector. + + Compatibility Note: these functions are not available with the + Apple/NeXT runtime. */ + +objc_EXPORT void *objc_malloc(size_t size); + +/* FIXME: Shouldn't the following be called objc_malloc_atomic ? The + GC function is GC_malloc_atomic() which makes sense. + */ +objc_EXPORT void *objc_atomic_malloc(size_t size); + +objc_EXPORT void *objc_realloc(void *mem, size_t size); + +objc_EXPORT void *objc_calloc(size_t nelem, size_t size); + +objc_EXPORT void objc_free(void *mem); + + /** Implementation: the following functions are in encoding.c. */ /* Traditional GNU Objective-C Runtime functions that are currently used to implement method forwarding. -*/ + + Compatibility Note: these functions are not available with the + Apple/NeXT runtime. */ /* Return the size of a variable which has the specified 'type' encoding. */ diff --git a/libobjc/objects.c b/libobjc/objects.c index 2562be55f24..7aaf9a3afa5 100644 --- a/libobjc/objects.c +++ b/libobjc/objects.c @@ -23,7 +23,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ #include "objc-private/common.h" -#include "objc/objc.h" #include "objc/objc-api.h" #include "objc-private/runtime.h" /* the kitchen sink */ diff --git a/libobjc/protocols.c b/libobjc/protocols.c index af62a2dba3a..6d429803c8f 100644 --- a/libobjc/protocols.c +++ b/libobjc/protocols.c @@ -23,7 +23,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ #include "objc-private/common.h" -#include "objc/objc.h" #include "objc/runtime.h" #include "objc-private/module-abi-8.h" /* For runtime structures */ #include "objc/thr.h" diff --git a/libobjc/sarray.c b/libobjc/sarray.c index 8d5303701e0..9dd160e51eb 100644 --- a/libobjc/sarray.c +++ b/libobjc/sarray.c @@ -24,9 +24,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "objc-private/common.h" #include "objc-private/sarray.h" -#include "objc/objc.h" -#include "objc/objc-api.h" -#include "objc/thr.h" +#include "objc/runtime.h" /* For objc_malloc */ +#include "objc/thr.h" /* For objc_mutex_lock */ #include "objc-private/runtime.h" #include <stdio.h> #include <string.h> /* For memset */ diff --git a/libobjc/selector.c b/libobjc/selector.c index 0c12130ae38..1d4bc7e69d7 100644 --- a/libobjc/selector.c +++ b/libobjc/selector.c @@ -23,7 +23,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ #include "objc-private/common.h" -#include "objc/objc.h" #include "objc/objc-api.h" #include "objc/thr.h" #include "objc-private/hash.h" diff --git a/libobjc/sendmsg.c b/libobjc/sendmsg.c index a822af4a31a..02be39c5b05 100644 --- a/libobjc/sendmsg.c +++ b/libobjc/sendmsg.c @@ -33,7 +33,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "tconfig.h" #include "coretypes.h" #include "tm.h" -#include "objc/objc.h" #include "objc/objc-api.h" #include "objc/thr.h" #include "objc-private/runtime.h" diff --git a/libobjc/thr.c b/libobjc/thr.c index 50196e81c58..609872d3d17 100644 --- a/libobjc/thr.c +++ b/libobjc/thr.c @@ -38,8 +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/objc.h" -#include "objc/objc-api.h" +#include "objc/runtime.h" #include "objc-private/runtime.h" #include <gthr.h> |