From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14065 invoked by alias); 9 Feb 2015 23:35:18 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 14039 invoked by uid 89); 9 Feb 2015 23:35:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-lb0-f169.google.com Received: from mail-lb0-f169.google.com (HELO mail-lb0-f169.google.com) (209.85.217.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 09 Feb 2015 23:35:16 +0000 Received: by mail-lb0-f169.google.com with SMTP id f15so32970075lbj.0 for ; Mon, 09 Feb 2015 15:35:13 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.152.28.227 with SMTP id e3mr20081853lah.117.1423524913392; Mon, 09 Feb 2015 15:35:13 -0800 (PST) Received: by 10.25.21.213 with HTTP; Mon, 9 Feb 2015 15:35:13 -0800 (PST) In-Reply-To: <1423524046-20605-10-git-send-email-palves@redhat.com> References: <1423524046-20605-1-git-send-email-palves@redhat.com> <1423524046-20605-10-git-send-email-palves@redhat.com> Date: Mon, 09 Feb 2015 23:35:00 -0000 Message-ID: Subject: Re: [PATCH 09/36] floatformat.h: Wrap in extern "C". From: Andrew Pinski To: Pedro Alves Cc: "gdb-patches@sourceware.org" , GCC Patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00231.txt.bz2 On Mon, Feb 9, 2015 at 3:20 PM, Pedro Alves wrote: > Just like libiberty.h. So that C++ programs, such as GDB when built > as a C++ program, can use it. Why is not needed for GCC building with C++ compiler? Thanks, Andrew > > include/ChangeLog: > 2015-02-09 Pedro Alves > > * floatformat.h [__cplusplus]: Wrap in extern "C". > --- > include/floatformat.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/include/floatformat.h b/include/floatformat.h > index 6b559864..71d332b 100644 > --- a/include/floatformat.h > +++ b/include/floatformat.h > @@ -20,6 +20,10 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. > #if !defined (FLOATFORMAT_H) > #define FLOATFORMAT_H 1 > > +#ifdef __cplusplus > +extern "C" { > +#endif > + > #include "ansidecl.h" > > /* A floatformat consists of a sign bit, an exponent and a mantissa. Once the > @@ -148,4 +152,8 @@ floatformat_from_double (const struct floatformat *, const double *, void *); > extern int > floatformat_is_valid (const struct floatformat *fmt, const void *from); > > +#ifdef __cplusplus > +} > +#endif > + > #endif /* defined (FLOATFORMAT_H) */ > -- > 1.9.3 >