This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3] C99 complex math vs. std::complex
Gabriel Dos Reis wrote:
That workaround was put in it back to 1999 (I think) because some targets
like alpha were unable to handle aggregate return in registers
(somehow provoked by the synthetized copy constructor). If you
can confirm that the bug was fixed on such targets, then it means that
macro was never defined since then, therefore it is no longer an
ABI-breaking patch. Otherwise, it would have to wait for so_7 branch.
I think it's safe to remove it because Benjamin removed back in 2001 the
relevant autoconf tests as obsolete: therefore nothing currently defines the
macro at install time and, by the way, it's also completely undocumented.
Anyway, the below is the complete set of tweaks that I have regtested on
x86-linux (ongoing x86-64 too).
Will wait 'til tomorrow morning italian time, in case of comments.
Thanks,
Paolo.
//////////////////////
2005-01-26 Paolo Carlini <pcarlini@suse.de>
* acinclude.m4 ([GLIBCXX_ENABLE_C99]): Add ac_c99_complex
in the final test for enable_c99, thus robustifying it; remove
duplicate final test on ac_99_math.
* configure: Regenerate.
* include/std/std_complex.h: Remove usages of the dead
_GLIBCXX_BUGGY_COMPLEX macro.
* testsuite/26_numerics/cmath/19322.cc: Protect with
_GLIBCXX_USE_C99_MATH instead of the stronger _GLIBCXX_USE_C99,
since only C99 math facilities are involved.
* testsuite/26_numerics/cmath/c99_classification_macros_c++.cc:
Likewise.
diff -urN libstdc++-v3-orig/acinclude.m4 libstdc++-v3/acinclude.m4
--- libstdc++-v3-orig/acinclude.m4 2005-01-25 18:23:08.000000000 +0100
+++ libstdc++-v3/acinclude.m4 2005-01-25 18:47:35.000000000 +0100
@@ -1055,6 +1055,7 @@
AC_MSG_CHECKING([for enabled ISO C99 support])
if test x"$ac_c99_math" = x"no" ||
+ test x"$ac_c99_complex" = x"no" ||
test x"$ac_c99_stdio" = x"no" ||
test x"$ac_c99_stdlib" = x"no" ||
test x"$ac_c99_wchar" = x"no"; then
@@ -1062,10 +1063,6 @@
fi;
AC_MSG_RESULT($enable_c99)
- if test x"$ac_99_math" = x"yes"; then
- AC_DEFINE(_GLIBCXX_USE_C99_MATH)
- fi
-
# Option parsed, now set things appropriately
if test x"$enable_c99" = x"yes"; then
AC_DEFINE(_GLIBCXX_USE_C99)
diff -urN libstdc++-v3-orig/include/std/std_complex.h libstdc++-v3/include/std/std_complex.h
--- libstdc++-v3-orig/include/std/std_complex.h 2005-01-25 18:23:11.000000000 +0100
+++ libstdc++-v3/include/std/std_complex.h 2005-01-25 18:58:10.000000000 +0100
@@ -995,9 +995,7 @@
complex(_ComplexT __z) : _M_value(__z) { }
complex(float = 0.0f, float = 0.0f);
-#if _GLIBCXX_BUGGY_COMPLEX
- complex(const complex& __z) : _M_value(__z._M_value) { }
-#endif
+
explicit complex(const complex<double>&);
explicit complex(const complex<long double>&);
@@ -1150,10 +1148,8 @@
complex(_ComplexT __z) : _M_value(__z) { }
- complex(double = 0.0, double = 0.0);
-#if _GLIBCXX_BUGGY_COMPLEX
- complex(const complex& __z) : _M_value(__z._M_value) { }
-#endif
+ complex(double = 0.0, double = 0.0);
+
complex(const complex<float>&);
explicit complex(const complex<long double>&);
@@ -1306,9 +1302,7 @@
complex(_ComplexT __z) : _M_value(__z) { }
complex(long double = 0.0L, long double = 0.0L);
-#if _GLIBCXX_BUGGY_COMPLEX
- complex(const complex& __z) : _M_value(__z._M_value) { }
-#endif
+
complex(const complex<float>&);
complex(const complex<double>&);
diff -urN libstdc++-v3-orig/testsuite/26_numerics/cmath/19322.cc libstdc++-v3/testsuite/26_numerics/cmath/19322.cc
--- libstdc++-v3-orig/testsuite/26_numerics/cmath/19322.cc 2005-01-16 10:59:06.000000000 +0100
+++ libstdc++-v3/testsuite/26_numerics/cmath/19322.cc 2005-01-25 19:07:17.000000000 +0100
@@ -28,7 +28,7 @@
#include <cmath>
#include <testsuite_hooks.h>
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_MATH
// libstdc++/19322
void test01()
{
@@ -40,7 +40,7 @@
int main()
{
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_MATH
test01();
#endif
return 0;
diff -urN libstdc++-v3-orig/testsuite/26_numerics/cmath/c99_classification_macros_c++.cc libstdc++-v3/testsuite/26_numerics/cmath/c99_classification_macros_c++.cc
--- libstdc++-v3-orig/testsuite/26_numerics/cmath/c99_classification_macros_c++.cc 2005-01-13 20:33:40.000000000 +0100
+++ libstdc++-v3/testsuite/26_numerics/cmath/c99_classification_macros_c++.cc 2005-01-25 19:07:45.000000000 +0100
@@ -55,7 +55,7 @@
void isunordered() { }
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_MATH
template <typename _Tp>
void test_c99_classify()
{
@@ -83,7 +83,7 @@
int main()
{
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_MATH
test_c99_classify<float>();
test_c99_classify<double>();
#endif