about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gftg@linux.vnet.ibm.com>2017-06-01 21:48:15 -0300
committerGabriel F. T. Gomes <gftg@linux.vnet.ibm.com>2017-06-12 14:48:53 -0300
commit8fd31014315921b4107de171d14b091dbe443226 (patch)
tree8191f019a70eb7b7d1c89d891f22ad3b9dac340b
parent7d641c411d475fc609edce8df12c4b2918b29fdb (diff)
downloadglibc-8fd31014315921b4107de171d14b091dbe443226.tar.gz
glibc-8fd31014315921b4107de171d14b091dbe443226.tar.xz
glibc-8fd31014315921b4107de171d14b091dbe443226.zip
Allow macros prefixed with FLT128 in include/float.h
TS 18661-3 specifies that macros prefixed with FLTN_ can be defined in
float.h, only if __STDC_WANT_IEC_60559_TYPES_EXT__ is defined as a macro
before the inclusion of float.h.  Since GCC 7.0, these macros are provided
under this condition, however, for older versions of GCC, these macros are
not provided at all.  This patch allows the definitions of such macros in
include/float.h for older compilers, if the condition above is met, and
even if _ISOMAC is defined.

	* include/float.h: Allow the definition of macros prefixed with
	FLT128 even if _ISOMAC is defined, but provided that
	__STDC_WANT_IEC_60559_TYPES_EXT__ is defined as a macro.
-rw-r--r--ChangeLog6
-rw-r--r--include/float.h31
2 files changed, 21 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 37e8e192b6..429690e1fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2017-06-12  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
 
+	* include/float.h: Allow the definition of macros prefixed with
+	FLT128 even if _ISOMAC is defined, but provided that
+	__STDC_WANT_IEC_60559_TYPES_EXT__ is defined as a macro.
+
+2017-06-12  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
+
 	* manual/math.texi (Mathematics): Add description for _FloatN and
 	_FloatNx types and mentions that they are not support in glibc for
 	any architecture, so far.
diff --git a/include/float.h b/include/float.h
index 20c4acbf78..a5b357dc96 100644
--- a/include/float.h
+++ b/include/float.h
@@ -10,22 +10,21 @@
 /* Supplement float.h macros for _Float128 for older compilers
    which do not yet support the type.  These are described in
    TS 18661-3.  */
-#ifndef _ISOMAC
-# include <features.h>
-# include <bits/floatn.h>
-# if !__GNUC_PREREQ (7, 0) && __HAVE_DISTINCT_FLOAT128
-#  define FLT128_MANT_DIG	113
-#  define FLT128_DECIMAL_DIG	36
-#  define FLT128_DIG		33
-#  define FLT128_MIN_EXP	(-16381)
-#  define FLT128_MIN_10_EXP	(-4931)
-#  define FLT128_MAX_EXP	16384
-#  define FLT128_MAX_10_EXP	4932
-#  define FLT128_MAX		1.18973149535723176508575932662800702e+4932Q
-#  define FLT128_EPSILON	1.92592994438723585305597794258492732e-34Q
-#  define FLT128_MIN		3.36210314311209350626267781732175260e-4932Q
-#  define FLT128_TRUE_MIN	6.47517511943802511092443895822764655e-4966Q
-# endif
+#include <features.h>
+#include <bits/floatn.h>
+#if !__GNUC_PREREQ (7, 0) \
+    && __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
+# define FLT128_MANT_DIG	113
+# define FLT128_DECIMAL_DIG	36
+# define FLT128_DIG		33
+# define FLT128_MIN_EXP		(-16381)
+# define FLT128_MIN_10_EXP	(-4931)
+# define FLT128_MAX_EXP		16384
+# define FLT128_MAX_10_EXP	4932
+# define FLT128_MAX		1.18973149535723176508575932662800702e+4932Q
+# define FLT128_EPSILON		1.92592994438723585305597794258492732e-34Q
+# define FLT128_MIN		3.36210314311209350626267781732175260e-4932Q
+# define FLT128_TRUE_MIN	6.47517511943802511092443895822764655e-4966Q
 #endif
 
 #endif /* _LIBC_FLOAT_H */