Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3/gcc.old/dist/libstdc++-v3/include/std Hack aro...



details:   https://anonhg.NetBSD.org/src/rev/38110b38e56d
branches:  trunk
changeset: 342860:38110b38e56d
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jan 11 16:49:09 2016 +0000

description:
Hack around the cabs mess, and explain what's going on...

diffstat:

 external/gpl3/gcc.old/dist/libstdc++-v3/include/std/complex |  17 ++++++++++--
 1 files changed, 14 insertions(+), 3 deletions(-)

diffs (40 lines):

diff -r f4aadd83cbc4 -r 38110b38e56d external/gpl3/gcc.old/dist/libstdc++-v3/include/std/complex
--- a/external/gpl3/gcc.old/dist/libstdc++-v3/include/std/complex       Mon Jan 11 14:55:52 2016 +0000
+++ b/external/gpl3/gcc.old/dist/libstdc++-v3/include/std/complex       Mon Jan 11 16:49:09 2016 +0000
@@ -44,6 +44,16 @@
 #include <cmath>
 #include <sstream>
 
+#if _GLIBCXX_USE_C99_COMPLEX
+// This is disgusting; we can't include ccomplex because that c++11
+// and we can't use the builtins because those point to the wrong
+// ABI-wise cabs/cabsf so we manually declare those here and use
+// them directly.
+extern "C" float __c99_cabsf(_Complex float);
+extern "C" double __c99_cabs(_Complex double);
+extern "C" long double __c99_cabsl(_Complex long double);
+#endif
+
 // Get rid of a macro possibly defined in <complex.h>
 #undef complex
 
@@ -580,15 +590,16 @@
     }
 
 #if _GLIBCXX_USE_C99_COMPLEX
+  // XXX: We can't use __builtin_cabs* because they are broken
   inline float
-  __complex_abs(__complex__ float __z) { return __builtin_cabsf(__z); }
+  __complex_abs(__complex__ float __z) { return __c99_cabsf(__z); }
 
   inline double
-  __complex_abs(__complex__ double __z) { return __builtin_cabs(__z); }
+  __complex_abs(__complex__ double __z) { return __c99_cabs(__z); }
 
   inline long double
   __complex_abs(const __complex__ long double& __z)
-  { return __builtin_cabsl(__z); }
+  { return __c99_cabsl(__z); }
 
   template<typename _Tp>
     inline _Tp



Home | Main Index | Thread Index | Old Index