[cfe-commits] r134407 - /cfe/trunk/lib/Headers/float.h
Douglas Gregor
dgregor at apple.com
Tue Jul 5 07:17:04 PDT 2011
Author: dgregor
Date: Tue Jul 5 09:17:04 2011
New Revision: 134407
URL: http://llvm.org/viewvc/llvm-project?rev=134407&view=rev
Log:
Teach Clang's <float.h> to also include MinGW's <float.h>, which provides additional system definitions, from Ruben Van Boxem
Modified:
cfe/trunk/lib/Headers/float.h
Modified: cfe/trunk/lib/Headers/float.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/float.h?rev=134407&r1=134406&r2=134407&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/float.h (original)
+++ cfe/trunk/lib/Headers/float.h Tue Jul 5 09:17:04 2011
@@ -24,6 +24,48 @@
#ifndef __FLOAT_H
#define __FLOAT_H
+/* If we're on MinGW, fall baack to the system's float.h, which might have
+ * additional definitions provided for Windows.
+ * For more details see http://msdn.microsoft.com/en-us/library/y0ybw9fy.aspx
+ */
+#if defined(__MINGW32__) && \
+ defined(__has_include_next) && __has_include_next(<float.h>)
+# include_next <float.h>
+
+/* Undefine anything that we'll be redefining below. */
+# undef FLT_EVAL_METHOD
+# undef FLT_ROUNDS
+# undef FLT_RADIX
+# undef FLT_MANT_DIG
+# undef DBL_MANT_DIG
+# undef LDBL_MANT_DIG
+# undef DECIMAL_DIG
+# undef FLT_DIG
+# undef DBL_DIG
+# undef LDBL_DIG
+# undef FLT_MIN_EXP
+# undef DBL_MIN_EXP
+# undef LDBL_MIN_EXP
+# undef FLT_MIN_10_EXP
+# undef DBL_MIN_10_EXP
+# undef LDBL_MIN_10_EXP
+# undef FLT_MAX_EXP
+# undef DBL_MAX_EXP
+# undef LDBL_MAX_EXP
+# undef FLT_MAX_10_EXP
+# undef DBL_MAX_10_EXP
+# undef LDBL_MAX_10_EXP
+# undef FLT_MAX
+# undef DBL_MAX
+# undef LDBL_MAX
+# undef FLT_EPSILON
+# undef DBL_EPSILON
+# undef LDBL_EPSILON
+# undef FLT_MIN
+# undef DBL_MIN
+# undef LDBL_MIN
+#endif
+
/* Characteristics of floating point types, C99 5.2.4.2.2 */
#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
More information about the cfe-commits
mailing list