From patchwork Mon Jul 25 14:30:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 106680 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 C5FAFB6F8F for ; Tue, 26 Jul 2011 00:30:33 +1000 (EST) Received: (qmail 25020 invoked by alias); 25 Jul 2011 14:30:31 -0000 Received: (qmail 25011 invoked by uid 22791); 25 Jul 2011 14:30:31 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 25 Jul 2011 14:30:17 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 633B590E; Mon, 25 Jul 2011 16:30:16 +0200 (CEST) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id gR8xHq2YrEwX; Mon, 25 Jul 2011 16:30:14 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id D68BB90D; Mon, 25 Jul 2011 16:30:14 +0200 (CEST) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.5+Sun/8.14.5/Submit) id p6PEUEJt004801; Mon, 25 Jul 2011 16:30:14 +0200 (MEST) From: Rainer Orth To: Ian Lance Taylor Cc: gcc-patches@gcc.gnu.org Subject: Re: Allow Tru64 UNIX bootstrap with C++ References: Date: Mon, 25 Jul 2011 16:30:14 +0200 In-Reply-To: (Ian Lance Taylor's message of "Fri, 22 Jul 2011 12:16:08 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (usg-unix-v) MIME-Version: 1.0 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 Ian Lance Taylor writes: > I'll preapprove a similar patch to libcpp/system.h if you want to take a > look at that. Sure. The following patch has been bootstrapped successfully on i386-pc-solaris2.11, installed on mainline. Rainer 2011-07-22 Rainer Orth * system.h [__cplusplus]: Wrap C function declarations in extern "C". diff --git a/libcpp/system.h b/libcpp/system.h --- a/libcpp/system.h +++ b/libcpp/system.h @@ -84,6 +84,10 @@ along with GCC; see the file COPYING3. # define fputc(C, Stream) fputc_unlocked (C, Stream) # endif +#ifdef __cplusplus +extern "C" { +#endif + # ifdef HAVE_CLEARERR_UNLOCKED # undef clearerr # define clearerr(Stream) clearerr_unlocked (Stream) @@ -164,6 +168,10 @@ extern int fprintf_unlocked (FILE *, con # endif # endif +#ifdef __cplusplus +} +#endif + #endif /* ??? Glibc's fwrite/fread_unlocked macros cause @@ -286,10 +294,18 @@ extern int errno; here. These checks will be in the undefined state while configure is running so be careful to test "defined (HAVE_DECL_*)". */ +#ifdef __cplusplus +extern "C" { +#endif + #if defined (HAVE_DECL_ABORT) && !HAVE_DECL_ABORT extern void abort (void); #endif +#ifdef __cplusplus +} +#endif + #if HAVE_SYS_STAT_H # include #endif