From: Nicola Pero Date: Sat, 11 Sep 2010 22:47:14 +0000 (+0000) Subject: In libobjc/: X-Git-Tag: releases/gcc-4.6.0~4389 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6dead247c97de92dc042afc5ff360a7c983dc39d;p=thirdparty%2Fgcc.git In libobjc/: * objc/objc.h (__GNU_LIBOBJC__): New #define providing an easy way to check the API version. Added some comments. * objc-private/common.h: New file. * NXConstStr.m: Include objc-private/common.h. * Object.m: Same change. * Protocol.m: Same change. * archive.c: Same change. * class.c: Same change. * encoding.c: Same change. * exception.c: Same change. * gc.c: Same change. * hash.c: Same change. * init.c: Same change. * libobjc_entry.c: Same change. * linking.m: Same change. * misc.c: Same change (and added a comment). * nil_method.c: Same change. * objects.c: Same change. * sarray.c: Same change. * selector.c: Same change. * sendmsg.c: Same change. * thr.c: Same change. From-SVN: r164218 --- diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog index 7830d06487cf..0fdcb6e46213 100644 --- a/libobjc/ChangeLog +++ b/libobjc/ChangeLog @@ -1,3 +1,29 @@ +2010-09-12 Nicola Pero + + * objc/objc.h (__GNU_LIBOBJC__): New #define providing an easy way + to check the API version. Added some comments. + + * objc-private/common.h: New file. + * NXConstStr.m: Include objc-private/common.h. + * Object.m: Same change. + * Protocol.m: Same change. + * archive.c: Same change. + * class.c: Same change. + * encoding.c: Same change. + * exception.c: Same change. + * gc.c: Same change. + * hash.c: Same change. + * init.c: Same change. + * libobjc_entry.c: Same change. + * linking.m: Same change. + * misc.c: Same change (and added a comment). + * nil_method.c: Same change. + * objects.c: Same change. + * sarray.c: Same change. + * selector.c: Same change. + * sendmsg.c: Same change. + * thr.c: Same change. + 2010-09-11 Nicola Pero * objc/objc-api.h: Removed obsolete #ifdef for NeXTSTEP. diff --git a/libobjc/NXConstStr.m b/libobjc/NXConstStr.m index 92281f618f11..7ff553b58ed4 100644 --- a/libobjc/NXConstStr.m +++ b/libobjc/NXConstStr.m @@ -23,6 +23,7 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ +#include "objc-private/common.h" #include "objc/NXConstStr.h" @implementation NXConstantString diff --git a/libobjc/Object.m b/libobjc/Object.m index 377f0594d1bf..3a5bcb31688c 100644 --- a/libobjc/Object.m +++ b/libobjc/Object.m @@ -22,6 +22,7 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ +#include "objc-private/common.h" #include #include #include "objc/Object.h" diff --git a/libobjc/Protocol.m b/libobjc/Protocol.m index 9fa7f9258731..49b7b3a43d42 100644 --- a/libobjc/Protocol.m +++ b/libobjc/Protocol.m @@ -22,6 +22,7 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ +#include "objc-private/common.h" #include "objc/Protocol.h" #include "objc/objc-api.h" diff --git a/libobjc/archive.c b/libobjc/archive.c index 87d5ad8375d0..6603ab12d51c 100644 --- a/libobjc/archive.c +++ b/libobjc/archive.c @@ -22,6 +22,7 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ +#include "objc-private/common.h" #include "tconfig.h" #include "objc/objc.h" #include "objc/objc-api.h" diff --git a/libobjc/class.c b/libobjc/class.c index c86cbb4dcc98..37b2b4eebf9b 100644 --- a/libobjc/class.c +++ b/libobjc/class.c @@ -87,6 +87,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see classes from the table - and the difficult thing with lock-free data structures is freeing data when is removed from the structures. */ +#include "objc-private/common.h" #include "objc/objc.h" #include "objc/objc-api.h" #include "objc/thr.h" diff --git a/libobjc/encoding.c b/libobjc/encoding.c index c743d865e17e..5694530a2200 100644 --- a/libobjc/encoding.c +++ b/libobjc/encoding.c @@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see /* FIXME: This file has no business including tm.h. */ +#include "objc-private/common.h" #include "tconfig.h" #include "coretypes.h" #include "tm.h" diff --git a/libobjc/exception.c b/libobjc/exception.c index 210beaee4065..bb6a9194af1e 100644 --- a/libobjc/exception.c +++ b/libobjc/exception.c @@ -22,6 +22,7 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ +#include "objc-private/common.h" #include #include "config.h" #include "objc/objc-api.h" diff --git a/libobjc/gc.c b/libobjc/gc.c index 70b3af4d948a..a67ba1c98553 100644 --- a/libobjc/gc.c +++ b/libobjc/gc.c @@ -23,6 +23,7 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ +#include "objc-private/common.h" #include "tconfig.h" #include "objc/objc.h" #include "objc/encoding.h" diff --git a/libobjc/hash.c b/libobjc/hash.c index 697f2e1b69bb..9e0a608c1301 100644 --- a/libobjc/hash.c +++ b/libobjc/hash.c @@ -22,6 +22,7 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ +#include "objc-private/common.h" #include "assert.h" #include "objc/objc.h" diff --git a/libobjc/init.c b/libobjc/init.c index ea6ab38569ea..75e0b1036ead 100644 --- a/libobjc/init.c +++ b/libobjc/init.c @@ -24,6 +24,7 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ +#include "objc-private/common.h" #include "objc/objc.h" #include "objc/objc-api.h" #include "objc/thr.h" diff --git a/libobjc/libobjc_entry.c b/libobjc/libobjc_entry.c index 13e47492136d..5cbc89c4f132 100644 --- a/libobjc/libobjc_entry.c +++ b/libobjc/libobjc_entry.c @@ -23,7 +23,7 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ - +#include "objc-private/common.h" #include /* diff --git a/libobjc/linking.m b/libobjc/linking.m index fa31bdf3c96f..6372e91df451 100644 --- a/libobjc/linking.m +++ b/libobjc/linking.m @@ -23,7 +23,7 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ - +#include "objc-private/common.h" #include #include diff --git a/libobjc/misc.c b/libobjc/misc.c index e67f345df5e9..fde1f3086719 100644 --- a/libobjc/misc.c +++ b/libobjc/misc.c @@ -24,9 +24,15 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ +#include "objc-private/common.h" +/* __USE_FIXED_PROTOTYPES__ used to be required to get prototypes for + malloc, free, etc. on some platforms. It is unclear if we still + need it, but it can't hurt. +*/ #define __USE_FIXED_PROTOTYPES__ #include + #include "objc/objc.h" #include "objc/objc-api.h" #include "objc-private/runtime.h" diff --git a/libobjc/nil_method.c b/libobjc/nil_method.c index a5364eab4ce1..752115f869e1 100644 --- a/libobjc/nil_method.c +++ b/libobjc/nil_method.c @@ -26,6 +26,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see /* This is the nil method, the function that is called when the receiver of a method is nil */ +#include "objc-private/common.h" #include "objc/objc.h" /* When the receiver of a method invocation is nil, the runtime diff --git a/libobjc/objc-private/common.h b/libobjc/objc-private/common.h new file mode 100644 index 000000000000..1642faa51390 --- /dev/null +++ b/libobjc/objc-private/common.h @@ -0,0 +1,38 @@ +/* GNU Objective C Runtime Common Private Definitions + Copyright (C) 2010 Free Software Foundation, Inc. + Contributed by Nicola Pero + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under the +terms of the GNU General Public License as published by the Free Software +Foundation; either version 3, or (at your option) any later version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +details. + +Under Section 7 of GPL version 3, you are granted additional +permissions described in the GCC Runtime Library Exception, version +3.1, as published by the Free Software Foundation. + +You should have received a copy of the GNU General Public License and +a copy of the GCC Runtime Library Exception along with this program; +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +. */ + +#ifndef __objc_private_common_INCLUDE_GNU +#define __objc_private_common_INCLUDE_GNU + +/* This file contains definitions that should be included by all .c + and .m files in libobjc. +*/ + +/* This variable allows the public headers to determine when they are + being included by a file inside libobjc itself, or when they are + being included by an external file. +*/ +#define GNU_LIBOBJC_COMPILING_LIBOBJC_ITSELF 1 + +#endif /* __objc_private_common_INCLUDE_GNU */ diff --git a/libobjc/objc/objc.h b/libobjc/objc/objc.h index 17ae49b17472..6c3214f5e08b 100644 --- a/libobjc/objc/objc.h +++ b/libobjc/objc/objc.h @@ -26,12 +26,27 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #ifndef __objc_INCLUDE_GNU #define __objc_INCLUDE_GNU +/* 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. +*/ + #ifdef __cplusplus extern "C" { #endif #include +/* 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. +*/ +#define __GNU_LIBOBJC__ 20100911 + /* Definition of the boolean type. diff --git a/libobjc/objects.c b/libobjc/objects.c index fcfce1e490da..0743af427a04 100644 --- a/libobjc/objects.c +++ b/libobjc/objects.c @@ -22,7 +22,7 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ - +#include "objc-private/common.h" #include "tconfig.h" /* include defs of bzero for target */ #include "objc/objc.h" #include "objc/objc-api.h" diff --git a/libobjc/sarray.c b/libobjc/sarray.c index 79172ea93bee..dd140c76f363 100644 --- a/libobjc/sarray.c +++ b/libobjc/sarray.c @@ -22,7 +22,7 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ - +#include "objc-private/common.h" #include "objc/sarray.h" #include "objc/objc.h" #include "objc/objc-api.h" diff --git a/libobjc/selector.c b/libobjc/selector.c index 1b611419da7f..52b6ba12da50 100644 --- a/libobjc/selector.c +++ b/libobjc/selector.c @@ -22,7 +22,7 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ - +#include "objc-private/common.h" #include "objc/objc.h" #include "objc/objc-api.h" #include "objc/thr.h" diff --git a/libobjc/sendmsg.c b/libobjc/sendmsg.c index 682fbe11022a..3bf28b975887 100644 --- a/libobjc/sendmsg.c +++ b/libobjc/sendmsg.c @@ -28,6 +28,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see /* FIXME: This should be using libffi instead of __builtin_apply and friends. */ +#include "objc-private/common.h" #include "tconfig.h" #include "coretypes.h" #include "tm.h" diff --git a/libobjc/thr.c b/libobjc/thr.c index 5b39ada27882..0a5853608d6f 100644 --- a/libobjc/thr.c +++ b/libobjc/thr.c @@ -22,6 +22,7 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ +#include "objc-private/common.h" #define _LIBOBJC /* The line below is needed for declarations of functions such as pthread_mutexattr_settype, without which gthr-posix.h may fail to