]> sourceware.org Git - newlib-cygwin.git/commitdiff
2009-04-24 Jeff johnston <jjohnstn@redhat.com>
authorJeff Johnston <jjohnstn@redhat.com>
Fri, 24 Apr 2009 22:49:55 +0000 (22:49 +0000)
committerJeff Johnston <jjohnstn@redhat.com>
Fri, 24 Apr 2009 22:49:55 +0000 (22:49 +0000)
        * configure.in: Add configuration test for long double equals dbl
        and set flag _LDBL_EQ_DBL if true.
        * configure: Regenerated.
        * newlib.hin: Add _LDBL_EQ_DBL flag.
        * libc/include/math.h: Use _LDBL_EQ_DBL flag instead of
        _HAVE_LDBL_MATH.
        * libc/include/stdlib.h: Use _LDBL_EQ_DBL flag instead of
        _HAVE_LDBL_STDLIB.
        * libc/common/local.h: Remove _LDBL_EQ_DBL flag setting.
        * libc/stdlib/local.h: Ditto.

newlib/ChangeLog
newlib/configure
newlib/configure.in
newlib/libc/include/math.h
newlib/libc/include/stdlib.h
newlib/libc/stdlib/local.h
newlib/libm/common/local.h
newlib/newlib.hin

index c81f47d462d9ae6b55724f8e45e27bf2ff24a5e1..c7f3110d0b9923719c7110484fd2b5236c92d095 100644 (file)
@@ -1,3 +1,16 @@
+2009-04-24  Jeff johnston  <jjohnstn@redhat.com>
+
+       * configure.in: Add configuration test for long double equals dbl
+       and set flag _LDBL_EQ_DBL if true.
+       * configure: Regenerated.
+       * newlib.hin: Add _LDBL_EQ_DBL flag.
+       * libc/include/math.h: Use _LDBL_EQ_DBL flag instead of
+       _HAVE_LDBL_MATH.
+       * libc/include/stdlib.h: Use _LDBL_EQ_DBL flag instead of
+       _HAVE_LDBL_STDLIB.
+       * libc/common/local.h: Remove _LDBL_EQ_DBL flag setting.
+       * libc/stdlib/local.h: Ditto.
+
 2009-04-24  Joseph Myers  <joseph@codesourcery.com>
 
        * libc/include/stdint.h (UINTPTR_MAX): Define to __UINTPTR_MAX__
index d2c7588b535ccfd1d0fa06e50a88a176420d0d95..1d9108d8818a81fa7f1047df3722281a4f00502b 100755 (executable)
@@ -11900,6 +11900,43 @@ if test $libc_cv_initfinit_array = yes; then
 #define HAVE_INITFINI_ARRAY 1
 _ACEOF
 
+fi
+
+echo "$as_me:$LINENO: checking long double equals double" >&5
+echo $ECHO_N "checking long double equals double... $ECHO_C" >&6
+if test "${newlib_ldbl_eq_dbl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat > conftest.c <<EOF
+#include <float.h>
+#if DBL_MANT_DIG == LDBL_MANT_DIG  &&  LDBL_MIN_EXP == DBL_MIN_EXP  && \
+    LDBL_MAX_EXP == DBL_MAX_EXP
+  #define _LDBL_EQ_DBL
+ #else
+  #error "LDBL != DBL"
+#endif
+EOF
+if { ac_try='${CC} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest conftest.c
+                  -static -nostartfiles -nostdlib 1>&5'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }
+then
+  newlib_ldbl_eq_dbl=yes;
+else
+  newlib_ldbl_eq_dbl=no;
+fi
+rm -f conftest*
+fi
+echo "$as_me:$LINENO: result: $newlib_ldbl_eq_dbl" >&5
+echo "${ECHO_T}$newlib_ldbl_eq_dbl" >&6
+if test $newlib_ldbl_eq_dbl = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define _LDBL_EQ_DBL 1
+_ACEOF
+
 fi
 
           ac_config_files="$ac_config_files Makefile"
index 01ca6a3a32d25d7e68642cd02340c7ea3db68fd8..9ff520100230b3a408e2b974942dc319c18dd388 100644 (file)
@@ -395,6 +395,29 @@ if test $libc_cv_initfinit_array = yes; then
   AC_DEFINE_UNQUOTED(HAVE_INITFINI_ARRAY)
 fi
 
+AC_CACHE_CHECK(long double equals double,
+              newlib_ldbl_eq_dbl, [dnl
+cat > conftest.c <<EOF
+#include <float.h>
+#if DBL_MANT_DIG == LDBL_MANT_DIG  &&  LDBL_MIN_EXP == DBL_MIN_EXP  && \
+    LDBL_MAX_EXP == DBL_MAX_EXP
+  #define _LDBL_EQ_DBL
+ #else
+  #error "LDBL != DBL"
+#endif
+EOF
+if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest conftest.c
+                  -static -nostartfiles -nostdlib 1>&AS_MESSAGE_LOG_FD])
+then
+  newlib_ldbl_eq_dbl=yes;
+else
+  newlib_ldbl_eq_dbl=no;
+fi
+rm -f conftest*])
+if test $newlib_ldbl_eq_dbl = yes; then
+  AC_DEFINE_UNQUOTED(_LDBL_EQ_DBL)
+fi
+
 AC_CONFIG_FILES([Makefile],
 [if test -n "$CONFIG_FILES"; then
   unset ac_file
index 87b2626b507c65044b52a4a51b693b8531eab1f9..3efdb3675c73154b2bad6f7e7f8b0d963a52508e 100644 (file)
@@ -334,8 +334,8 @@ extern float log2f _PARAMS((float));
 extern float hypotf _PARAMS((float, float));
 #endif /* ! defined (_REENT_ONLY) */
 
-/* On platforms where long double math functions are supported.  */
-#ifdef _HAVE_LDBL_MATH
+/* On platforms where long double equals double.  */
+#ifdef _LDBL_EQ_DBL
 /* Reentrant ANSI C functions.  */
 #ifndef __math_68881
 extern long double atanl _PARAMS((long double));
@@ -400,14 +400,14 @@ extern long double lgammal _PARAMS((long double));
 extern long double erfl _PARAMS((long double));
 extern long double erfcl _PARAMS((long double));
 #endif /* ! defined (_REENT_ONLY) */
-#else /* !_HAVE_LDBL_MATH */
+#else /* !_LDBL_EQ_DBL */
 #ifdef __i386__
 /* Other long double precision functions.  */
 extern _LONG_DOUBLE rintl _PARAMS((_LONG_DOUBLE));
 extern long int lrintl _PARAMS((_LONG_DOUBLE));
 extern _LONG_LONG_TYPE llrintl _PARAMS((_LONG_DOUBLE));
 #endif /* __i386__ */
-#endif /* !_HAVE_LDBL_MATH */
+#endif /* !_LDBL_EQ_DBL */
 
 #endif /* !defined (__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L */
 
index 7dfb7798326e6400e0733dea5a48085083d0a52f..8f7d31e183eeeb8ba8fea3b0b9a4e1af859d9516 100644 (file)
@@ -199,11 +199,11 @@ int       _EXFUN(_system_r,(struct _reent *, const char *));
 
 _VOID  _EXFUN(__eprintf,(const char *, const char *, unsigned int, const char *));
 
-/* On platforms where long double stdlib functions are supported.  */
-#ifdef _HAVE_LDBL_STDLIB
+/* On platforms where long double equals double.  */
+#ifdef _LDBL_EQ_DBL
 extern long double strtold (const char *, char **);
 extern long double wcstold (const wchar_t *, wchar_t **);
-#endif /* _HAVE_LDBL_STDLIB */
+#endif /* _LDBL_EQ_DBL */
 
 _END_STD_C
 
index 3e8eb02c677460625fac099ac8e6ef039df8ba7b..703d70eed14fd659fec78f84aa148fcd6821b67b 100644 (file)
@@ -63,13 +63,4 @@ int __iso_8859_index (const char *);
 extern wchar_t __cp_conv[12][0x80];
 int __cp_index (const char *);
 
-#include <float.h>
-
-/* Check if long double is as wide as double. */
-#if (!defined(__STRICT_ANSI__) || __STDC_VERSION__ > 199901L || \
-  defined(__cplusplus)) && defined(LDBL_MANT_DIG) && \
-    (DBL_MANT_DIG == LDBL_MANT_DIG && LDBL_MIN_EXP == DBL_MIN_EXP && \
-    LDBL_MAX_EXP == DBL_MAX_EXP)
- #define _LDBL_EQ_DBL
-#endif
 #endif
index 9e32afacb902d098438f73a5d1d142e0acef991e..8461d02152cf889f5676d5a2be07b36823baaad5 100644 (file)
@@ -1,9 +1 @@
-#include <float.h>
-
-/* Check if long double is as wide as double. */
-#if (!defined(__STRICT_ANSI__) || __STDC_VERSION__ > 199901L || \
-  defined(__cplusplus)) && defined(LDBL_MANT_DIG) && \
-    (DBL_MANT_DIG == LDBL_MANT_DIG && LDBL_MIN_EXP == DBL_MIN_EXP && \
-    LDBL_MAX_EXP == DBL_MAX_EXP)
- #define _LDBL_EQ_DBL
-#endif
+/* placeholder for future usage.  */
index b643411e92523fb4a3323a7f9ceda8223562ea60..f7afdebb76fc5094a7c867f984f2203bde5db7e8 100644 (file)
@@ -46,6 +46,9 @@
    functions.  */
 #undef  _ATEXIT_DYNAMIC_ALLOC
 
+/* True if long double supported and it is equal to double.  */
+#undef  _LDBL_EQ_DBL
+
 /*
  * Iconv encodings enabled ("to" direction)
  */
This page took 0.072243 seconds and 5 git commands to generate.