This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] powerpc: Fix the compiler mode used with C++ when -mabi=ieeelongdouble
- From: Tulio Magno Quites Machado Filho <tuliom at linux dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Cc: meissner at linux dot ibm dot com
- Date: Fri, 27 Apr 2018 14:11:50 -0300
- Subject: [PATCH] powerpc: Fix the compiler mode used with C++ when -mabi=ieeelongdouble
When compiling C++ code with -mabi=ieeelongdouble, KCtype is
unavailable and TCtype should be used instead.
2018-04-27 Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
* sysdeps/powerpc/bits/floatn.h [__HAVE_FLOAT128
&& (!__GNUC_PREREQ (7, 0) || defined __cplusplus)
&& __LDBL_MANT_DIG__ == 113] (__cfloat128): Use compiler mode __TC__.
Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
---
sysdeps/powerpc/bits/floatn.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/sysdeps/powerpc/bits/floatn.h b/sysdeps/powerpc/bits/floatn.h
index c3834096e3..9ba1b81380 100644
--- a/sysdeps/powerpc/bits/floatn.h
+++ b/sysdeps/powerpc/bits/floatn.h
@@ -66,10 +66,14 @@
/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */
# if __HAVE_FLOAT128
+/* Add a typedef for older GCC and C++ compilers which don't natively support
+ _Complex _Float128.. */
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
-/* Add a typedef for older GCC compilers which don't natively support
- _Complex _Float128. */
+# if __LDBL_MANT_DIG__ == 113
+typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
+# else
typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__KC__)));
+# endif
# define __CFLOAT128 __cfloat128
# else
# define __CFLOAT128 _Complex _Float128
--
2.14.3