aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorStan Shebs <shebs@apple.com>2002-08-16 23:31:06 +0000
committerStan Shebs <shebs@gcc.gnu.org>2002-08-16 23:31:06 +0000
commit8aa5074e79a708a7ef26c5931a1f6485a0726042 (patch)
tree0feaf1d60d2fdc7c20d36fa3d93b48a48eb425f7 /gcc
parentca75573a5d8f17e1baa009caef0ea72bcece3932 (diff)
downloadgcc-8aa5074e79a708a7ef26c5931a1f6485a0726042.zip
gcc-8aa5074e79a708a7ef26c5931a1f6485a0726042.tar.gz
gcc-8aa5074e79a708a7ef26c5931a1f6485a0726042.tar.bz2
c-common.c (cb_register_builds): Define __NEXT_RUNTIME__ for ObjC with -fnext-runtime.
* c-common.c (cb_register_builds): Define __NEXT_RUNTIME__ for ObjC with -fnext-runtime. * doc/cpp.texi: Document it. * objc/execute/selector-1.m: Add __NEXT_RUNTIME__ case. From-SVN: r56390
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/c-common.c4
-rw-r--r--gcc/doc/cpp.texi4
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/objc/execute/selector-1.m12
5 files changed, 26 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 18c72b7..dbb8057f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2002-08-16 Stan Shebs <shebs@apple.com>
+
+ * c-common.c (cb_register_builds): Define __NEXT_RUNTIME__
+ for ObjC with -fnext-runtime.
+ * doc/cpp.texi: Document it.
+
2002-08-16 Janis Johnson <janis187@us.ibm.com>
* doc/install.texi (Final installation): Replace links to individual
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 2268d72..74224af 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -4745,6 +4745,10 @@ cb_register_builtins (pfile)
if (!flag_signed_char)
cpp_define (pfile, "__CHAR_UNSIGNED__");
+ /* Make the choice of ObjC runtime visible to source code. */
+ if (flag_objc && flag_next_runtime)
+ cpp_define (pfile, "__NEXT_RUNTIME__");
+
/* A straightforward target hook doesn't work, because of problems
linking that hook's body when part of non-C front ends. */
# define preprocessing_asm_p() (cpp_get_options (pfile)->lang == CLK_ASM)
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi
index e8107f2..1284a39 100644
--- a/gcc/doc/cpp.texi
+++ b/gcc/doc/cpp.texi
@@ -2003,6 +2003,10 @@ the typedefs.
This macro is defined, with value 1, if the compiler uses the old
mechanism based on @code{setjmp} and @code{longjmp} for exception
handling.
+
+@item __NEXT_RUNTIME__
+This macro is defined, with value 1, when the NeXT runtime
+(as in @option{-fnext-runtime}) is in use for Objective-C.
@end table
@node System-specific Predefined Macros
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e7fb943..bd0a52f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2002-08-16 Stan Shebs <shebs@apple.com>
+
+ * objc/execute/selector-1.m: Add __NEXT_RUNTIME__ case.
+
2002-08-15 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/typeof-1.c: New test.
diff --git a/gcc/testsuite/objc/execute/selector-1.m b/gcc/testsuite/objc/execute/selector-1.m
index 7e21da5..531e02b 100644
--- a/gcc/testsuite/objc/execute/selector-1.m
+++ b/gcc/testsuite/objc/execute/selector-1.m
@@ -6,12 +6,16 @@
int main (void)
{
SEL selector;
+ char *selname;
selector = @selector (alloc);
- if (strcmp (sel_get_name (selector), "alloc"))
- {
- abort ();
- }
+#ifdef __NEXT_RUNTIME__
+ selname = sel_getName (selector);
+#else
+ selname = sel_get_name (selector);
+#endif
+ if (strcmp (selname, "alloc"))
+ abort ();
return 0;
}