summaryrefslogtreecommitdiff
path: root/lib/Headers
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-02-12 01:15:33 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-02-12 01:15:33 +0000
commitd14e35f115c7e253d25928e671411766f0f3fc76 (patch)
tree33ef4f5d0a7baf1083689f488ecbc9957c800bbb /lib/Headers
parent25e062e55e631aafc84fd27cc9580d0065096c02 (diff)
downloadclang-d14e35f115c7e253d25928e671411766f0f3fc76.tar.gz
<float.h>: do not define DECIMAL_DIG in -std=c89 mode; this macro was added in C99.
Patch by Jorge Teixeira! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260639 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Headers')
-rw-r--r--lib/Headers/float.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Headers/float.h b/lib/Headers/float.h
index 50cfdaabaf..a28269ebeb 100644
--- a/lib/Headers/float.h
+++ b/lib/Headers/float.h
@@ -39,7 +39,9 @@
# undef FLT_MANT_DIG
# undef DBL_MANT_DIG
# undef LDBL_MANT_DIG
-# undef DECIMAL_DIG
+# if __STDC_VERSION__ >= 199901L || !defined(__STRICT_ANSI__)
+# undef DECIMAL_DIG
+# endif
# undef FLT_DIG
# undef DBL_DIG
# undef LDBL_DIG
@@ -84,7 +86,9 @@
#define DBL_MANT_DIG __DBL_MANT_DIG__
#define LDBL_MANT_DIG __LDBL_MANT_DIG__
-#define DECIMAL_DIG __DECIMAL_DIG__
+#if __STDC_VERSION__ >= 199901L || !defined(__STRICT_ANSI__)
+# define DECIMAL_DIG __DECIMAL_DIG__
+#endif
#define FLT_DIG __FLT_DIG__
#define DBL_DIG __DBL_DIG__