This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 4/8] Add support for testing __STDC_WANT_IEC_60559_TYPES_EXT__
- From: "Gabriel F. T. Gomes" <gftg at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Date: Wed, 9 Nov 2016 16:40:55 -0200
- Subject: [PATCH 4/8] Add support for testing __STDC_WANT_IEC_60559_TYPES_EXT__
- Authentication-results: sourceware.org; auth=none
- References: <1478716859-3246-1-git-send-email-gftg@linux.vnet.ibm.com>
From: "Paul E. Murphy" <murphyp@linux.vnet.ibm.com>
This is defined by TS 18661-3 for supporting the _FloatN
and _FloatNx types.
This will also implicitly enforce a minimum GCC 4.9. Given
the standard is a C11 derivative, it would seem reasonable
to assume a C11 compiler with _Generic support. This allows
for much simpler type classification macros which in theory
should be supported on any C11 compiler.
* bits/libc-header-start.h:
(__GLIBC_USR_IEC_60559_TYPES_EXT): New macro.
---
bits/libc-header-start.h | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/bits/libc-header-start.h b/bits/libc-header-start.h
index ee6a876..251ff05 100644
--- a/bits/libc-header-start.h
+++ b/bits/libc-header-start.h
@@ -59,3 +59,18 @@
#else
# define __GLIBC_USE_IEC_60559_FUNCS_EXT 0
#endif
+
+/* ISO/IEC TS 18661-3:2014 defines the
+ __STDC_WANT_IEC_60559_TYPES_EXT__ macro.
+
+ Note, as a tradeoff for keeping the headers simple, this will
+ require C11 Generic support. Thus, GCC 4.9 is mandated when
+ requesting this support and using GCC. */
+#undef __GLIBC_USE_IEC_60559_TYPES_EXT
+#if (defined __STDC_WANT_IEC_60559_TYPES_EXT__ || defined __USE_GNU) \
+ && defined __USE_ISOC11 \
+ && ((defined __GNUC__ && __GNUC_PREREQ (4, 9)) || !defined __GNUC__)
+# define __GLIBC_USE_IEC_60559_TYPES_EXT 1
+#else
+# define __GLIBC_USE_IEC_60559_TYPES_EXT 0
+#endif
--
2.4.11