If compiling with 'gcc -std=c++11' for instance, gcc defines __STRICT_ANSI__ and, thus, the mathematical constants in math.h that are also defined in POSIX.1 (see http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/math.h.html for reference) are undefined, although _POSIX_C_SOURCE or the former _POSIX_SOURCE is set appropriately. Adding "defined(_POSIX_C_SOURCE) || defined(_POSIX_SOURCE) || ..." to the list of guards in math.h:39 fixes the issue. Please see the attached patch.

Best regards,

Thomas
--- trunk/mingw-w64-headers/crt/math.h	2015-09-10 14:22:26 +0200
+++ trunk/mingw-w64-headers/crt/math.h	2015-09-10 14:29:00 +0200
@@ -36,7 +36,7 @@
 #endif
 #endif
 
-#if !defined(__STRICT_ANSI__) || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_USE_MATH_DEFINES)
+#if !defined(__STRICT_ANSI__) || defined(_POSIX_C_SOURCE) || defined(_POSIX_SOURCE) || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_USE_MATH_DEFINES)
 #define M_E		2.7182818284590452354
 #define M_LOG2E		1.4426950408889634074
 #define M_LOG10E	0.43429448190325182765
------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to