Patchwork [darwin] nullify __strong/__weak for non-Objc-gc case.

login
register
mail settings
Submitter IainS
Date Sept. 30, 2010, 2:55 p.m.
Message ID <CE59B962-EE55-4B98-A64A-E2EC6C683A20@sandoe-acoustics.co.uk>
Download mbox | patch
Permalink /patch/66177/
State New
Headers show

Comments

IainS - Sept. 30, 2010, 2:55 p.m.
Hi,

We don't (yet) support gc for NeXT ObjC (that's a V2 ABI thing).
So we should ignore the strong/weak tags (which is what the V2  
compiler does when gc is off).

tested on i686-darwin9.

OK for trunk?
Iain

gcc

	config/darwin-c.c (darwin_cpp_builtins): Define __strong and __weak  
to null.



  /* Handle C family front-end options.  */

Patch

Index: gcc/config/darwin-c.c
===================================================================
--- gcc/config/darwin-c.c	(revision 164748)
+++ gcc/config/darwin-c.c	(working copy)
@@ -610,6 +610,14 @@  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 (yet, 4.6) support ObjC gc for the NeXT runtime,  
the
+     following defines apply unconditionally.  Without this NeXT system
+     headers cannot be parsed properly.  */
+  {
+    builtin_define ("__strong=");
+    builtin_define ("__weak=");
+  }
  }