This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
400+ libstdc++ testsuite failures due to missing definition of M_PI
- From: David Billinghurst <dbcygwin at gmail dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Thu, 14 May 2009 15:15:07 +1000
- Subject: 400+ libstdc++ testsuite failures due to missing definition of M_PI
Most of the 400+ libstdc++ testsuite failures on cygwin are of the form:
/usr/local/obj/gcc-20090510/i686-pc-cygwin/libstdc++-v3/include/bits/random.tcc:1661:
error: 'M_PI' was not declared in this scope
This happens since:
(1) the tests are compiled with -std=c++0x
(2) which defines __STRICT_ANSI__ 1,
(3) which prevents the definition of M_PI in <math.h> and <cmath>
This is not unreasonable, as the C++0X standard (from ISO/IEC JTC 1/SC
22 N 4411 2008-10-09) doesn't mention M_PI (in <cmath> or elsewhere).
One simple but crude fix is to define M_PI in
libstdc++-v3/include/bits/random.tcc
#ifndef M_PI
#define M_PI 3.14159265358979323846
Any better ideas?