On 17/11/15 13:33 +0100, Rainer Orth wrote:
Solaris 12 recently introduced the C++11 <math.h> overloads, which
caused bootstrap to be broken on both mainline and the gcc-5 branch:
In file included from
/vol/gcc/src/hg/trunk/local/libstdc++-v3/include/precompiled/stdc++.h:41:0:
/var/gcc/regression/trunk/12-gcc/build/i386-pc-solaris2.12/libstdc++-v3/include/cmath:
In function 'constexpr int std::fpclassify(float)':
/var/gcc/regression/trunk/12-gcc/build/i386-pc-solaris2.12/libstdc++-v3/include/cmath:561:3:
error: redefinition of 'constexpr int std::fpclassify(float)'
fpclassify(float __x)
^
In file included from /usr/include/math.h:13:0,
from
/var/gcc/regression/trunk/12-gcc/build/i386-pc-solaris2.12/libstdc++-v3/include/cmath:44,
from
/vol/gcc/src/hg/trunk/local/libstdc++-v3/include/precompiled/stdc++.h:41:
/usr/include/iso/math_c99.h:647:13: note: 'int std::fpclassify(float)'
previously defined here
inline int fpclassify(float __X) { return __builtin_fpclassify(
^
The following patch fixes this by testing for the problem and wrapping
the overloads in include/c_global/cmath and include/tr1/cmath
appropriately. The test needs to be dynamic since apparently a backport
to Solaris 11 (and perhaps even Solaris 10) is planned.
Why does <tr1/cmath> need to change, did Solaris also define the
functions in namespace std::tr1?