From patchwork Thu Oct 14 13:47:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 67826 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id EBA26B70E6 for ; Fri, 15 Oct 2010 00:47:47 +1100 (EST) Received: (qmail 13491 invoked by alias); 14 Oct 2010 13:47:44 -0000 Received: (qmail 13477 invoked by uid 22791); 14 Oct 2010 13:47:43 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, TW_BJ X-Spam-Check-By: sourceware.org Received: from c2bthomr13.btconnect.com (HELO mail.btconnect.com) (213.123.20.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 Oct 2010 13:47:28 +0000 Received: from host81-138-1-83.in-addr.btopenworld.com (EHLO thor.office) ([81.138.1.83]) by c2bthomr13.btconnect.com with ESMTP id AGP13086; Thu, 14 Oct 2010 14:47:23 +0100 (BST) Message-Id: From: IainS To: GCC Patches Mime-Version: 1.0 (Apple Message framework v936) Subject: [Patch, ObjC/Darwin, committed] partial merge of objc gc from branch. Date: Thu, 14 Oct 2010 14:47:09 +0100 Cc: Mike Stump X-Mirapoint-IP-Reputation: reputation=Fair-1, source=Queried, refid=tid=0001.0A0B0302.4CB709DE.0128, actions=tag X-Junkmail-Signature-Raw: score=unknown, refid=str=0001.0A0B020A.4CB709ED.024E, ss=1, fgs=0, ip=0.0.0.0, so=2010-07-22 22:03:31, dmn=2009-09-10 00:05:08, mode=single engine X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, this is another piece of the jigsaw towards being able to parse NeXT headers on Darwin >= 9. This shifts a parse error from a valid supported case to the unsupported case... r165469 Iain gcc: Partial merge of 'ObjC GC' from FSF apple 'trunk' branch. * config/darwin-c.c (darwin_cpp_builtins): Define __weak and __strong macros. Index: gcc/config/darwin-c.c =================================================================== --- gcc/config/darwin-c.c (revision 165465) +++ gcc/config/darwin-c.c (working copy) @@ -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. */