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:
authorJeff Johnston <jjohnstn@redhat.com>2009-05-15 20:15:57 +0400
committerJeff Johnston <jjohnstn@redhat.com>2009-05-15 20:15:57 +0400
commitde8a5b78105f9c7f60213a4d15a31a03f7485b6d (patch)
treeea9f18eb497d1a05f8370ce2b7f974ed3afee1c9 /newlib/libm
parent7aa710a782ffee5e1f824ca53436296bc9242f20 (diff)
2009-05-15 Craig Howland <howland@LGSInnovations.com>
* configure.in: Add configuration test for long double type existing and set flag _HAVE_LONG_DOUBLE if true. Fix INIT_ARRAY (.init_array) and _LDBL_EQ_DBL tests to not link so that will work with cross-compilers. * configure: Regenerated. * Makefile.in: Ditto. * newlib.hin: Add _HAVE_LONG_DOUBLE flag. * libc/include/math.h: Change non-builtin defines for HUGE_VAL, HUGE_VALF, and HUGE_VALL to be constant expressions. Add definitions for the non-builtin case for INFINITY and NAN. Gate HUGE_VALL and union __ldmath definitions with (new) _HAVE_LONG_DOUBLE. *libm/common/s_infconst.c: Change definitions to use values from float.h instead of non-so-portable integer forms. Mark as being deprecated (because now removed from math.h, are not used anywhere in Newlib, itself).
Diffstat (limited to 'newlib/libm')
-rw-r--r--newlib/libm/common/s_infconst.c39
1 files changed, 10 insertions, 29 deletions
diff --git a/newlib/libm/common/s_infconst.c b/newlib/libm/common/s_infconst.c
index 9447b97cc..47a9dca19 100644
--- a/newlib/libm/common/s_infconst.c
+++ b/newlib/libm/common/s_infconst.c
@@ -3,38 +3,19 @@
*/
#include <float.h>
-#include "fdlibm.h"
+#include <math.h>
+/* These should never actually be used any longer, as their use in math.h was
+ * removed, but they are kept here in case a user was pointing to them.
+ * FIXME: deprecate these identifiers and then delete them. */
+
/* Float version of infinity. */
-const union __fmath __infinityf[1] = {{{0x7f800000}}};
+const union __fmath __infinityf[1] = { { FLT_MAX+FLT_MAX } };
/* Double version of infinity. */
-#ifndef _DOUBLE_IS_32BITS
- #ifdef __IEEE_BIG_ENDIAN
- const union __dmath __infinity[1] = {{{0x7ff00000, 0}}};
- #else
- const union __dmath __infinity[1] = {{{0, 0x7ff00000}}};
- #endif
-#else /* defined (_DOUBLE_IS_32BITS) */
- const union __dmath __infinity[1] = {{{0x7f800000, 0}}};
-#endif /* defined (_DOUBLE_IS_32BITS) */
+const union __dmath __infinity[1] = { { DBL_MAX+DBL_MAX } };
/* Long double version of infinity. */
-#ifdef __IEEE_BIG_ENDIAN
- #if LDBL_MANT_DIG == 24
- const union __ldmath __infinityld[1] = {{{0x7f800000, 0, 0, 0}}};
- #elif LDBL_MANT_DIG == 53
- const union __ldmath __infinityld[1] = {{{0x7ff00000, 0, 0, 0}}};
- #else
- const union __ldmath __infinityld[1] = {{{0x7fff0000, 0, 0, 0}}};
- #endif /* LDBL_MANT_DIG size */
-#else /* __IEEE_LITTLE_ENDIAN */
- #if LDBL_MANT_DIG == 24
- const union __ldmath __infinityld[1] = {{{0x7f800000, 0, 0, 0}}};
- #elif LDBL_MANT_DIG == 53
- const union __ldmath __infinityld[1] = {{{0, 0x7ff00000, 0, 0}}};
- #else
- const union __ldmath __infinityld[1] = {{{0, 0x80000000, 0x00007fff, 0}}};
- #endif /* LDBL_MANT_DIG size */
-#endif /* __IEEE_LITTLE_ENDIAN */
-
+#if defined(_HAVE_LONG_DOUBLE)
+const union __ldmath __infinityld[1] = { { LDBL_MAX+LDBL_MAX } };
+#endif