From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1892 invoked by alias); 18 Aug 2011 10:24:33 -0000 Received: (qmail 1879 invoked by uid 22791); 18 Aug 2011 10:24:32 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail1-relais-roc.national.inria.fr (HELO mail1-relais-roc.national.inria.fr) (192.134.164.82) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 18 Aug 2011 10:24:18 +0000 Received: from afontenayssb-151-1-53-14.w82-121.abo.wanadoo.fr (HELO laptop-mg.local) ([82.121.88.14]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 Aug 2011 12:24:15 +0200 Date: Thu, 18 Aug 2011 11:39:00 -0000 From: Marc Glisse To: Rainer Orth cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: Re: [v3] Use Solaris prototypes if possible (PR libstdc++-v3/1773) In-Reply-To: Message-ID: References: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-08/txt/msg01466.txt.bz2 On Tue, 9 Aug 2011, Rainer Orth wrote: > This patch is the last but one in the series to finally fix > > PR libstdc++-v3/1773 __cplusplus defined to 1, should be 199711L Only piece left before the switch :-) > * include/c_global/cmath (double abs(double)): Wrap in > !__CORRECT_ISO_CPP_MATH_H_PROTO1 && > !__CORRECT_ISO_CPP_MATH_H_PROTO2. > (float abs(float), long double abs(long double): Wrap in > !__CORRECT_ISO_CPP_MATH_H_PROTO1. > (float acos(float), long double acos(long double)): Likewise. [...] I guess it would also be possible to reorder the declarations so as to have a single #ifdef (well, two), but then the various overloads of each function wouldn't be adjacent anymore. > * include/tr1/cmath (float fabs(float), long double fabs(long > double)): Wrap in !__CORRECT_ISO_CPP_MATH_H_PROTO1. There is a comment: // Note: we deal with fabs in a special way, because an using std::fabs // would bring in also the overloads for complex types, which in C++0x // mode have a different return type. and then it proceeds to using ::fabs and declare the float and long double overloads. Now on solaris, using ::fabs is going to be equivalent to using std::fabs. I don't know if that creates problems for the complex types, and in that case what can be done about it (declare fabs(double) instead of importing the global one?). -- Marc Glisse