Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2003-10-21 13:10:51 +0400
committerDanny Smith <dannysmith@users.sourceforge.net>2003-10-21 13:10:51 +0400
commit359e09e7fd01afd36e4d8ac8291c6fb69b182ffb (patch)
tree9ea0de9fdeb9f2c5a0e770d2b2f9773c8569a5b4 /winsup/mingw/mingwex
parent672126d4f1a62a3030d5d1439d41a05525e472d5 (diff)
* mingwex/math/cephes_mconf.h (NAN, NANF, NANL):
Use GCC __builtin's if available. (INFINITY, INFINITYF, INFINITYL): Likewise.
Diffstat (limited to 'winsup/mingw/mingwex')
-rw-r--r--winsup/mingw/mingwex/math/cephes_mconf.h26
1 files changed, 23 insertions, 3 deletions
diff --git a/winsup/mingw/mingwex/math/cephes_mconf.h b/winsup/mingw/mingwex/math/cephes_mconf.h
index 85e0bdcf0..9818c4546 100644
--- a/winsup/mingw/mingwex/math/cephes_mconf.h
+++ b/winsup/mingw/mingwex/math/cephes_mconf.h
@@ -33,13 +33,17 @@
#define PIO4 7.85398163397448309616E-1
#define NEGZERO (-0.0)
-extern double __INF;
+#undef NAN
#undef INFINITY
+#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2))
+#define INFINITY __builtin_huge_val()
+#define NAN __builtin_nan("")
+#else
+extern double __INF;
#define INFINITY (__INF)
extern double __QNAN;
-#undef NAN
#define NAN (__QNAN)
-
+#endif
/*long double*/
#define MAXNUML 1.189731495357231765021263853E4932L
@@ -57,10 +61,18 @@ extern double __QNAN;
#define signbitl signbit
#define NEGZEROL (-0.0L)
+
+#undef NANL
+#undef INFINITYL
+#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2))
+#define INFINITYL __builtin_huge_vall()
+#define NANL __builtin_nanl("")
+#else
extern long double __INFL;
#define INFINITYL (__INFL)
extern long double __QNANL;
#define NANL (__QNANL)
+#endif
/* float */
@@ -79,10 +91,18 @@ extern long double __QNANL;
#define signbitf signbit
#define NEGZEROF (-0.0F)
+
+#undef NANF
+#undef INFINITYF
+#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2))
+#define INFINITYF __builtin_huge_valf()
+#define NANF __builtin_nanf("")
+#else
extern float __INFF;
#define INFINITYF (__INFF)
extern float __QNANF;
#define NANF (__QNANF)
+#endif
/* double */