aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIain Sandoe <iains@gcc.gnu.org>2010-10-14 13:45:28 +0000
committerIain Sandoe <iains@gcc.gnu.org>2010-10-14 13:45:28 +0000
commit560d6bd5b53d6e9b92cf25b9dcb53590f830c45e (patch)
treef07396510fc170a2e011fc09486b4bf2a43a40fb /gcc
parenta61c3633ecd0b8392496674a28e8efcd0cec8ab9 (diff)
downloadgcc-560d6bd5b53d6e9b92cf25b9dcb53590f830c45e.zip
gcc-560d6bd5b53d6e9b92cf25b9dcb53590f830c45e.tar.gz
gcc-560d6bd5b53d6e9b92cf25b9dcb53590f830c45e.tar.bz2
Partial merge of 'ObjC GC' from FSF apple 'trunk' branch.
* config/darwin-c.c (darwin_cpp_builtins): Define __weak and __strong macros. From-SVN: r165469
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/darwin-c.c16
2 files changed, 22 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5281089..f3b6db0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-10-14 Iain Sandoe <iains@gcc.gnu.org>
+
+ Partial merge of 'ObjC GC' from FSF apple 'trunk' branch.
+ * config/darwin-c.c (darwin_cpp_builtins): Define __weak and
+ __strong macros.
+
2010-10-14 Eric Botcazou <ebotcazou@adacore.com>
* sched-deps.c (sched_insn_is_legitimate_for_speculation): Invoke
diff --git a/gcc/config/darwin-c.c b/gcc/config/darwin-c.c
index 1419711..b5dc632 100644
--- a/gcc/config/darwin-c.c
+++ b/gcc/config/darwin-c.c
@@ -610,6 +610,22 @@ darwin_cpp_builtins (cpp_reader *pfile)
builtin_define_with_value ("__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__",
version_as_macro(), false);
+
+ /* Since we do not (at 4.6) support ObjC gc for the NeXT runtime, the
+ following will cause a syntax error if one tries to compile gc attributed
+ items. However, without this, NeXT system headers cannot be parsed
+ properly (on systems >= darwin 9). */
+ if (flag_objc_gc)
+ {
+ builtin_define ("__strong=__attribute__((objc_gc(strong)))");
+ builtin_define ("__weak=__attribute__((objc_gc(weak)))");
+ builtin_define ("__OBJC_GC__");
+ }
+ else
+ {
+ builtin_define ("__strong=");
+ builtin_define ("__weak=");
+ }
}
/* Handle C family front-end options. */