summaryrefslogtreecommitdiff
path: root/libobjc
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-19 07:47:55 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-19 07:47:55 +0000
commit2f698318a3e16c0027de887a6323db1297ccbba6 (patch)
treeafd6e43657b33930b3dfa8da68a8a14102855327 /libobjc
parentc060b640e1955cd60562892cfa7d780e90644ee2 (diff)
downloadgcc-2f698318a3e16c0027de887a6323db1297ccbba6.tar.gz
2010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 165680 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@165681 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libobjc')
-rw-r--r--libobjc/ChangeLog14
-rw-r--r--libobjc/init.c11
-rw-r--r--libobjc/linking.m5
-rw-r--r--libobjc/objc/message.h6
-rw-r--r--libobjc/objc/runtime.h8
5 files changed, 31 insertions, 13 deletions
diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog
index 1d2b2948605..3c79186211b 100644
--- a/libobjc/ChangeLog
+++ b/libobjc/ChangeLog
@@ -1,3 +1,17 @@
+2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ * objc/message.h: Moved initial includes outside of extern "C".
+ * objc/runtime.h: Add extern "C" for Objective-C++.
+
+2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ * init.c (objc_send_load): Do not wait for NXConstantString to be
+ registered before executing +load. There is no point if
+ -fconstant-string-class=xxx is used when compiling all modules,
+ as is the case for almost all users.
+ * linking.m (__objc_linking): Do not try to forcefully link in
+ NXConstantString.
+
2010-10-16 Nicola Pero <nicola.pero@meta-innovation.com>
* objc/runtime.h: Updated comments.
diff --git a/libobjc/init.c b/libobjc/init.c
index dd8789c9cac..d87a587a8af 100644
--- a/libobjc/init.c
+++ b/libobjc/init.c
@@ -444,8 +444,7 @@ class_is_subclass_of_class (Class class, Class superclass)
their superclasses are not yet known to the runtime. */
static struct objc_list *unresolved_classes = 0;
-/* Extern function used to reference the Object and NXConstantString
- classes. */
+/* Extern function used to reference the Object class. */
extern void __objc_force_linking (void);
@@ -755,11 +754,9 @@ objc_send_load (void)
return;
}
- /* Special check to allow creating and sending messages to constant
- strings in +load methods. If these classes are not yet known,
- even if all the other classes are known, delay sending of +load. */
- if (! objc_lookup_class ("NXConstantString") ||
- ! objc_lookup_class ("Object"))
+ /* Special check. If 'Object', which is used by meta-classes, has
+ not been loaded yet, delay sending of +load. */
+ if (! objc_lookup_class ("Object"))
return;
/* Iterate over all modules in the __objc_module_list and call on
diff --git a/libobjc/linking.m b/libobjc/linking.m
index e94c8ea8c4b..4438a668ce4 100644
--- a/libobjc/linking.m
+++ b/libobjc/linking.m
@@ -27,12 +27,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include <objc/Object.h>
#include <objc/NXConstStr.h>
-/* Generate references to Object and NXConstanstString classes since they are
- needed by the runtime system to run correctly. */
+/* Generate references to Object class since it is needed by the
+ runtime system to run correctly. */
void __objc_linking (void)
{
[Object name];
- [NXConstantString name];
}
diff --git a/libobjc/objc/message.h b/libobjc/objc/message.h
index f0038e714ac..b87153ea61c 100644
--- a/libobjc/objc/message.h
+++ b/libobjc/objc/message.h
@@ -26,13 +26,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#ifndef __objc_message_INCLUDE_GNU
#define __objc_message_INCLUDE_GNU
+#include "objc.h"
+#include "objc-decls.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "objc.h"
-#include "objc-decls.h"
-
/* This file includes declarations of the messaging functions and
types.
*/
diff --git a/libobjc/objc/runtime.h b/libobjc/objc/runtime.h
index 0b6f3dfc99b..b37eee2125b 100644
--- a/libobjc/objc/runtime.h
+++ b/libobjc/objc/runtime.h
@@ -50,6 +50,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "objc.h"
#include "objc-decls.h"
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
/* An 'Ivar' represents an instance variable. It holds information
about the name, type and offset of the instance variable. */
typedef struct objc_ivar *Ivar;
@@ -1042,4 +1046,8 @@ void objc_layout_structure_get_info (struct objc_struct_layout *layout,
unsigned int *align,
const char **type);
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif