| delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| DomainKey-Signature: | a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id |
| :list-unsubscribe:list-subscribe:list-archive:list-post | |
| :list-help:sender:message-id:date:from:mime-version:to:subject | |
| :references:in-reply-to:content-type; q=dns; s=default; b=grNRsi | |
| LGjYwz3WQGCEsbx0dnipcV10+KkDduZ4F9QRz5UsmOt/cAstoZkqinbBx8+SQFTj | |
| MbWAlUQBD08fZEGkYVJnjq5aIJz18pRmPzGWYnfx8ZjCq9aRkwauJ3cfwqF6SXv8 | |
| j5K7GszR7YAEaEM7ZBZNGvY6pa5s8oUI9Mubs= | |
| DKIM-Signature: | v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id |
| :list-unsubscribe:list-subscribe:list-archive:list-post | |
| :list-help:sender:message-id:date:from:mime-version:to:subject | |
| :references:in-reply-to:content-type; s=default; bh=IztJlmzAGGo/ | |
| Wq19RJ59atQ+n8A=; b=MDIX4y71lPIh6cA23GajLnOhlJNfrWhtV+Uq0zuc7axJ | |
| 8BqqJG9gObjpCcCZgmIB5vgMikWzhixraa8w/Jw2BXjq6qOBgUTXo7dvzHdu/0IF | |
| StR7OkUcGIzUW7OFYbHr3uIT+sUSOMBn7DZe+fgriN1Je8XOSXo34baBEI50NGQ= | |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Id: | <cygwin.cygwin.com> |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| Authentication-Results: | sourceware.org; auth=none |
| X-Virus-Found: | No |
| X-Spam-SWARE-Status: | No, score=-1.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 |
| X-HELO: | mailout04.t-online.de |
| Message-ID: | <55034F93.10800@t-online.de> |
| Date: | Fri, 13 Mar 2015 21:58:59 +0100 |
| From: | Christian Franke <Christian DOT Franke AT t-online DOT de> |
| User-Agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0 SeaMonkey/2.32 |
| MIME-Version: | 1.0 |
| To: | cygwin AT cygwin DOT com |
| Subject: | Re: g++4.9.2 fails to compile standard C++11 code |
| References: | <CAJ+GnyeViXtbQ6S=tC6z8XVZgOcoHv6Gi0ww8W1HEG_XKJrhUw AT mail DOT gmail DOT com> <20150312095559 DOT GA2644 AT dimstar DOT local DOT net> <CAEhDDbDrfTgUrxOdk3h2T=zn3Edng12vtnrb5csAS7fRYM9PMQ AT mail DOT gmail DOT com> <20150313094647 DOT GB20626 AT calimero DOT vinschen DOT de> |
| In-Reply-To: | <20150313094647.GB20626@calimero.vinschen.de> |
| X-IsSubscribed: | yes |
--------------070206080801040409020200
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Corinna Vinschen wrote:
> On Mar 13 09:13, Csaba Raduly wrote:
>> Hi
>>
>> On Thu, Mar 12, 2015 at 10:55 AM, Duncan Roe wrote:
>>> On Wed, Mar 11, 2015 at 06:55:16PM -0400, Vlad Gheorghiu wrote:
>>>> The following code fails to compile under latest cygwin, Windows 7,
>>>> g++4.9.2. Compiled with g++ -std=c++11 test.cpp. The compiler
>>>> complains that std::log2 is not a member of std.
>>>>
>>>> #include <cmath>
>>>> #include <iostream>
>>>>
>>>> int main()
>>>> {
>>>> auto x = std::log2(10);
>>>> std::cout << x << std::endl;
>>>> }
>>>>
>>>>
>>>> Verbatim error:
>>>>
>>>> g++ -std=c++11 test.cpp
>>>> test.cpp: In function 'int main()':
>>>> test.cpp:5:11: error: 'log2' is not a member of 'std'
>>>> auto x = std::log2(10);
>>>> ^
>>>> test.cpp:5:11: note: suggested alternative:
>>>> In file included from
>>>> /usr/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/cmath:44:0,
>>>> from test.cpp:1:
>>>> /usr/include/math.h:305:15: note: ???log2???
>>>> extern double log2 _PARAMS((double));
>>>>
>>> FWIW, this program works fine under Linux / gcc4.8.2:
>> ISTR a discussion about some C++11 features being configured away due
>> to Cygwin's lack of some C library functions ("to_string not a member
>> of std"): https://sourceware.org/ml/cygwin/2015-01/msg00245.html
>>
>> Your issue may be related (I'm guessing here because I don't have
>> Cygwin at hand right now).
> I guess the same. The problem is probably related to the fact that
> newlib is still missing most of the long double functions (cosl, sinl,
> etc). The libstdc++ configury seems to activate the related std methods
> only if *all* related C library functions for double, float and long
> double (e.g. cos, cosf, cosl) are implemented by the platform.
Yes. The attached patch for cmath include file would fix this.
Christian
--------------070206080801040409020200
Content-Type: text/x-patch;
name="cmath-c99-functions.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="cmath-c99-functions.patch"
--- /usr/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/cmath.orig 2015-02-24 02:02:20.000000000 +0100
+++ /usr/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/cmath 2015-03-13 09:39:58.098696700 +0100
@@ -922,7 +922,7 @@ _GLIBCXX_END_NAMESPACE_VERSION
#if __cplusplus >= 201103L
-#ifdef _GLIBCXX_USE_C99_MATH_TR1
+#if defined(_GLIBCXX_USE_C99_MATH_TR1) || defined(__CYGWIN__)
#undef acosh
#undef acoshf
@@ -1041,87 +1041,66 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// functions
using ::acosh;
using ::acoshf;
- using ::acoshl;
using ::asinh;
using ::asinhf;
- using ::asinhl;
using ::atanh;
using ::atanhf;
- using ::atanhl;
using ::cbrt;
using ::cbrtf;
- using ::cbrtl;
using ::copysign;
using ::copysignf;
- using ::copysignl;
using ::erf;
using ::erff;
- using ::erfl;
using ::erfc;
using ::erfcf;
- using ::erfcl;
using ::exp2;
using ::exp2f;
- using ::exp2l;
using ::expm1;
using ::expm1f;
- using ::expm1l;
using ::fdim;
using ::fdimf;
- using ::fdiml;
using ::fma;
using ::fmaf;
- using ::fmal;
using ::fmax;
using ::fmaxf;
- using ::fmaxl;
using ::fmin;
using ::fminf;
- using ::fminl;
using ::hypot;
using ::hypotf;
- using ::hypotl;
using ::ilogb;
using ::ilogbf;
- using ::ilogbl;
using ::lgamma;
using ::lgammaf;
- using ::lgammal;
using ::llrint;
using ::llrintf;
- using ::llrintl;
using ::llround;
using ::llroundf;
- using ::llroundl;
using ::log1p;
using ::log1pf;
- using ::log1pl;
using ::log2;
using ::log2f;
- using ::log2l;
using ::logb;
using ::logbf;
- using ::logbl;
using ::lrint;
using ::lrintf;
@@ -1129,31 +1108,21 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using ::lround;
using ::lroundf;
- using ::lroundl;
using ::nan;
using ::nanf;
- using ::nanl;
using ::nearbyint;
using ::nearbyintf;
- using ::nearbyintl;
using ::nextafter;
using ::nextafterf;
- using ::nextafterl;
-
- using ::nexttoward;
- using ::nexttowardf;
- using ::nexttowardl;
using ::remainder;
using ::remainderf;
- using ::remainderl;
using ::remquo;
using ::remquof;
- using ::remquol;
using ::rint;
using ::rintf;
@@ -1161,23 +1130,56 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using ::round;
using ::roundf;
- using ::roundl;
using ::scalbln;
using ::scalblnf;
- using ::scalblnl;
using ::scalbn;
using ::scalbnf;
- using ::scalbnl;
using ::tgamma;
using ::tgammaf;
- using ::tgammal;
using ::trunc;
using ::truncf;
+
+#ifndef __CYGWIN__
+ using ::acoshl;
+ using ::asinhl;
+ using ::atanhl;
+ using ::cbrtl;
+ using ::copysignl;
+ using ::erfl;
+ using ::erfcl;
+ using ::exp2l;
+ using ::expm1l;
+ using ::fdiml;
+ using ::fmal;
+ using ::fmaxl;
+ using ::fminl;
+ using ::hypotl;
+ using ::ilogbl;
+ using ::lgammal;
+ using ::llrintl;
+ using ::llroundl;
+ using ::log1pl;
+ using ::log2l;
+ using ::logbl;
+ using ::lroundl;
+ using ::nanl;
+ using ::nearbyintl;
+ using ::nextafterl;
+ using ::nexttoward;
+ using ::nexttowardf;
+ using ::nexttowardl;
+ using ::remainderl;
+ using ::remquol;
+ using ::roundl;
+ using ::scalblnl;
+ using ::scalbnl;
+ using ::tgammal;
using ::truncl;
+#endif
/// Additional overloads.
constexpr float
--------------070206080801040409020200
Content-Type: text/plain; charset=us-ascii
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
--------------070206080801040409020200--
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |