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-04-16 22:24:35 +0400
committerJeff Johnston <jjohnstn@redhat.com>2009-04-16 22:24:35 +0400
commit65f414dc16c64a1f2a31c48868df63424f27ca1e (patch)
treec268d8f92a98c27903d191898a456f5923b0c5f6 /newlib/libc
parent47d39ee0b65a84949c14410e584a6d36bb4ae6d8 (diff)
2009-04-16 Ken Werner <ken.werner@de.ibm.com>
* libm/libm.texinfo: Add long double function support chapter. * libc/include/machine/ieeefp.h: Add _LDBL_EQ_DBL define. * libc/include/stdlib.h: Include <machine/ieeefp.h>. (strtold, wcstold): Declare. * libc/stdlib/strtold.c: New File. * libc/stdlib/wcstold.c: Likewise. * libc/configure.in: Add long double check. * libc/configure: Regenerate. * libc/stdlib/Makefile.am: Add strtold.c and wcstold.c. * libc/stdlib/Makefile.in: Regenerate. * libc/include/math.h (atanl, cosl, sinl, tanl, tanhl): Declare. (frexpl, modfl, ceill, fabsl, floorl, log1pl, expm1l, acosl): Ditto. (asinl, atan2l, coshl, sinhl, expl, ldexpl, logl, log10l, powl): Ditto. (sqrtl, fmodl, hypotl, copysignl, nanl, ilogbl, asinhl, cbrt): Ditto. (nextafterl, rintl, scalbnl, exp2l, scalblnl, tgammal): Ditto. (nearbyintl, lrintl, llrintl, roundl, lroundl, llround): Ditto. (llroundl, truncl, remquol, fdiml, fmaxl, fminl, fmal, acoshl): Ditto. (atanhl, remainderl, lgammal, erfl, erfcl): Ditto. * libm/common/atanl.c: New File. * libm/common/cosl.c: Likewise. * libm/common/sinl.c: Likewise. * libm/common/modfl.c: Likewise. * libm/common/frexpl.c: Likewise. * libm/common/tanhl.c: Likewise. * libm/common/tanl.c: Likewise. * libm/common/expm1l.c: Likewise. * libm/common/log1pl.c: Likewise. * libm/common/ceill.c: Likewise. * libm/common/fabsl.c: Likewise. * libm/common/floorl.c: Likewise. * libm/common/acosl.c: Likewise. * libm/common/asinl.c: Likewise. * libm/common/atan2l.c: Likewise. * libm/common/coshl.c: Likewise. * libm/common/expl.c: Likewise. * libm/common/fmodl.c: Likewise. * libm/common/hypotl.c: Likewise. * libm/common/ldexpl.c: Likewise. * libm/common/log10l.c: Likewise. * libm/common/logl.c: Likewise. * libm/common/powl.c: Likewise. * libm/common/sqrtl.c: Likewise. * libm/common/copysignl.c: Likewise. * libm/common/ilogbl.c: Likewise. * libm/common/nanl.c: Likewise. * libm/common/cbrtl.c: Likewise. * libm/common/asinhl.c: Likewise. * libm/common/nextafterl.c: Likewise. * libm/common/rintl.c: Likewise. * libm/common/scalbnl.c: Likewise. * libm/common/exp2l.c: Likewise. * libm/common/fdiml.c: Likewise. * libm/common/fmal.c: Likewise. * libm/common/fmaxl.c: Likewise. * libm/common/fminl.c: Likewise. * libm/common/lrintl.c: Likewise. * libm/common/lroundl.c: Likewise. * libm/common/nearbyintl.c: Likewise. * libm/common/remquol.c: Likewise. * libm/common/roundl.c: Likewise. * libm/common/scalblnl.c: Likewise. * libm/common/truncl.c: Likewise. * libm/common/acoshl.c: Likewise. * libm/common/atanhl.c: Likewise. * libm/common/erfcl.c: Likewise. * libm/common/erfl.c: Likewise. * libm/common/lgammal.c: Likewise. * libm/common/remainderl.c: Likewise. * libm/common/tgammal.c: Likewise. * libm/common/sinhl.c: Likewise. * libm/common/llroundl.c: Likewise. * libm/configure.in: Add long double check. * libm/configure: Regenerate. * libm/common/Makefile.am: Add new files. * libm/common/Makefile.in: Regenerate.
Diffstat (limited to 'newlib/libc')
-rwxr-xr-xnewlib/libc/configure75
-rw-r--r--newlib/libc/configure.in10
-rw-r--r--newlib/libc/include/machine/ieeefp.h7
-rw-r--r--newlib/libc/include/math.h69
-rw-r--r--newlib/libc/include/stdlib.h7
-rw-r--r--newlib/libc/stdlib/Makefile.am6
-rw-r--r--newlib/libc/stdlib/Makefile.in170
-rw-r--r--newlib/libc/stdlib/strtold.c41
-rw-r--r--newlib/libc/stdlib/wcstold.c41
9 files changed, 329 insertions, 97 deletions
diff --git a/newlib/libc/configure b/newlib/libc/configure
index d16cc4cfc..c236894f7 100755
--- a/newlib/libc/configure
+++ b/newlib/libc/configure
@@ -459,7 +459,7 @@ ac_includes_default="\
#endif"
ac_subdirs_all="$ac_subdirs_all machine sys"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAY_SUPPLY_SYSCALLS_TRUE MAY_SUPPLY_SYSCALLS_FALSE newlib_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB READELF ac_ct_READELF MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CCAS CCASFLAGS NEWLIB_CFLAGS LDFLAGS ELIX_LEVEL_0_TRUE ELIX_LEVEL_0_FALSE ELIX_LEVEL_1_TRUE ELIX_LEVEL_1_FALSE ELIX_LEVEL_2_TRUE ELIX_LEVEL_2_FALSE ELIX_LEVEL_3_TRUE ELIX_LEVEL_3_FALSE ELIX_LEVEL_4_TRUE ELIX_LEVEL_4_FALSE USE_LIBTOOL_TRUE USE_LIBTOOL_FALSE OBJEXT oext aext lpfx libm_machine_dir machine_dir sys_dir SED DLLTOOL ac_ct_DLLTOOL OBJDUMP ac_ct_OBJDUMP LIBTOOL CFLAGS CPPFLAGS ac_ct_CC EXEEXT EGREP FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S lt_ECHO DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 ac_ct_OTOOL64 CPP subdirs CRT0 LIBC_POSIX_LIB HAVE_POSIX_DIR_TRUE HAVE_POSIX_DIR_FALSE LIBC_SIGNAL_LIB LIBC_SIGNAL_DEF HAVE_SIGNAL_DIR_TRUE HAVE_SIGNAL_DIR_FALSE LIBC_STDIO_LIB LIBC_STDIO_DEF HAVE_STDIO_DIR_TRUE HAVE_STDIO_DIR_FALSE LIBC_STDIO64_LIB LIBC_STDIO64_DEF HAVE_STDIO64_DIR_TRUE HAVE_STDIO64_DIR_FALSE LIBC_SYSCALL_LIB HAVE_SYSCALL_DIR_TRUE HAVE_SYSCALL_DIR_FALSE LIBC_UNIX_LIB HAVE_UNIX_DIR_TRUE HAVE_UNIX_DIR_FALSE LIBC_EXTRA_LIB LIBC_EXTRA_DEF extra_dir LIBC_SYS_LIB ENABLE_NEWLIB_ICONV_TRUE ENABLE_NEWLIB_ICONV_FALSE LIBC_MACHINE_LIB LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAY_SUPPLY_SYSCALLS_TRUE MAY_SUPPLY_SYSCALLS_FALSE newlib_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB READELF ac_ct_READELF MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CCAS CCASFLAGS NEWLIB_CFLAGS LDFLAGS ELIX_LEVEL_0_TRUE ELIX_LEVEL_0_FALSE ELIX_LEVEL_1_TRUE ELIX_LEVEL_1_FALSE ELIX_LEVEL_2_TRUE ELIX_LEVEL_2_FALSE ELIX_LEVEL_3_TRUE ELIX_LEVEL_3_FALSE ELIX_LEVEL_4_TRUE ELIX_LEVEL_4_FALSE USE_LIBTOOL_TRUE USE_LIBTOOL_FALSE OBJEXT oext aext lpfx libm_machine_dir machine_dir sys_dir SED DLLTOOL ac_ct_DLLTOOL OBJDUMP ac_ct_OBJDUMP LIBTOOL CFLAGS CPPFLAGS ac_ct_CC EXEEXT EGREP FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S lt_ECHO DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 ac_ct_OTOOL64 CPP subdirs CRT0 LIBC_POSIX_LIB HAVE_POSIX_DIR_TRUE HAVE_POSIX_DIR_FALSE LIBC_SIGNAL_LIB LIBC_SIGNAL_DEF HAVE_SIGNAL_DIR_TRUE HAVE_SIGNAL_DIR_FALSE LIBC_STDIO_LIB LIBC_STDIO_DEF HAVE_STDIO_DIR_TRUE HAVE_STDIO_DIR_FALSE LIBC_STDIO64_LIB LIBC_STDIO64_DEF HAVE_STDIO64_DIR_TRUE HAVE_STDIO64_DIR_FALSE LIBC_SYSCALL_LIB HAVE_SYSCALL_DIR_TRUE HAVE_SYSCALL_DIR_FALSE LIBC_UNIX_LIB HAVE_UNIX_DIR_TRUE HAVE_UNIX_DIR_FALSE LIBC_EXTRA_LIB LIBC_EXTRA_DEF extra_dir LIBC_SYS_LIB ENABLE_NEWLIB_ICONV_TRUE ENABLE_NEWLIB_ICONV_FALSE HAVE_LONG_DOUBLE_TRUE HAVE_LONG_DOUBLE_FALSE LIBC_MACHINE_LIB LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -11516,6 +11516,70 @@ else
fi
+echo "$as_me:$LINENO: checking Checking long double support" >&5
+echo $ECHO_N "checking Checking long double support... $ECHO_C" >&6
+if test "${acnewlib_cv_type_long_double+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+long double foo = 0.0L;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (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
+ acnewlib_cv_type_long_double = yes;
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+acnewlib_cv_type_long_double = no;
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $acnewlib_cv_type_long_double" >&5
+echo "${ECHO_T}$acnewlib_cv_type_long_double" >&6
+
+
+if test x"$acnewlib_cv_type_long_double" = x"yes"; then
+ HAVE_LONG_DOUBLE_TRUE=
+ HAVE_LONG_DOUBLE_FALSE='#'
+else
+ HAVE_LONG_DOUBLE_TRUE='#'
+ HAVE_LONG_DOUBLE_FALSE=
+fi
+
+
if test -n "${machine_dir}"; then
if test "${use_libtool}" = "yes"; then
LIBC_MACHINE_LIB=machine/${machine_dir}/lib${machine_dir}.${aext}
@@ -11776,6 +11840,13 @@ echo "$as_me: error: conditional \"ENABLE_NEWLIB_ICONV\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
+if test -z "${HAVE_LONG_DOUBLE_TRUE}" && test -z "${HAVE_LONG_DOUBLE_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"HAVE_LONG_DOUBLE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_LONG_DOUBLE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
@@ -12715,6 +12786,8 @@ s,@extra_dir@,$extra_dir,;t t
s,@LIBC_SYS_LIB@,$LIBC_SYS_LIB,;t t
s,@ENABLE_NEWLIB_ICONV_TRUE@,$ENABLE_NEWLIB_ICONV_TRUE,;t t
s,@ENABLE_NEWLIB_ICONV_FALSE@,$ENABLE_NEWLIB_ICONV_FALSE,;t t
+s,@HAVE_LONG_DOUBLE_TRUE@,$HAVE_LONG_DOUBLE_TRUE,;t t
+s,@HAVE_LONG_DOUBLE_FALSE@,$HAVE_LONG_DOUBLE_FALSE,;t t
s,@LIBC_MACHINE_LIB@,$LIBC_MACHINE_LIB,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
diff --git a/newlib/libc/configure.in b/newlib/libc/configure.in
index 1a42c1323..d88c38679 100644
--- a/newlib/libc/configure.in
+++ b/newlib/libc/configure.in
@@ -140,6 +140,16 @@ AC_SUBST(sys_dir)
dnl iconv library will be compiled if --enable-newlib-iconv option is enabled
AM_CONDITIONAL(ENABLE_NEWLIB_ICONV, test x${newlib_iconv} != x)
+dnl Autoconf 2.59 doesn't support the AC_TYPE_LONG_DOUBLE macro. Instead of:
+dnl AC_TYPE_LONG_DOUBLE
+dnl AM_CONDITIONAL(HAVE_LONG_DOUBLE, test x"$ac_cv_type_long_double" = x"yes")
+dnl we specify our own long double test.
+AC_CACHE_CHECK([Checking long double support], [acnewlib_cv_type_long_double],
+ [AC_TRY_COMPILE([], [long double foo = 0.0L;],
+ [acnewlib_cv_type_long_double = yes;],
+ [acnewlib_cv_type_long_double = no;])])
+AM_CONDITIONAL(HAVE_LONG_DOUBLE, test x"$acnewlib_cv_type_long_double" = x"yes")
+
if test -n "${machine_dir}"; then
if test "${use_libtool}" = "yes"; then
LIBC_MACHINE_LIB=machine/${machine_dir}/lib${machine_dir}.${aext}
diff --git a/newlib/libc/include/machine/ieeefp.h b/newlib/libc/include/machine/ieeefp.h
index b3c793741..bbbec5473 100644
--- a/newlib/libc/include/machine/ieeefp.h
+++ b/newlib/libc/include/machine/ieeefp.h
@@ -331,3 +331,10 @@
#endif /* not __IEEE_LITTLE_ENDIAN */
#endif /* not __IEEE_BIG_ENDIAN */
+/* 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
diff --git a/newlib/libc/include/math.h b/newlib/libc/include/math.h
index 5125d009f..95f0e216b 100644
--- a/newlib/libc/include/math.h
+++ b/newlib/libc/include/math.h
@@ -334,12 +334,79 @@ extern float log2f _PARAMS((float));
extern float hypotf _PARAMS((float, float));
#endif /* ! defined (_REENT_ONLY) */
-/* Other long double precision functions. */
+/* On platforms where long double is as wide as double. */
+#ifdef _LDBL_EQ_DBL
+/* Reentrant ANSI C functions. */
+#ifndef __math_68881
+extern long double atanl _PARAMS((long double));
+extern long double cosl _PARAMS((long double));
+extern long double sinl _PARAMS((long double));
+extern long double tanl _PARAMS((long double));
+extern long double tanhl _PARAMS((long double));
+extern long double frexpl _PARAMS((long double value, int *));
+extern long double modfl _PARAMS((long double, long double *));
+extern long double ceill _PARAMS((long double));
+extern long double fabsl _PARAMS((long double));
+extern long double floorl _PARAMS((long double));
+extern long double log1pl _PARAMS((long double));
+extern long double expm1l _PARAMS((long double));
+#endif /* ! defined (__math_68881) */
+/* Non reentrant ANSI C functions. */
+#ifndef _REENT_ONLY
+#ifndef __math_68881
+extern long double acosl _PARAMS((long double));
+extern long double asinl _PARAMS((long double));
+extern long double atan2l _PARAMS((long double, long double));
+extern long double coshl _PARAMS((long double));
+extern long double sinhl _PARAMS((long double));
+extern long double expl _PARAMS((long double));
+extern long double ldexpl _PARAMS((long double, int));
+extern long double logl _PARAMS((long double));
+extern long double log10l _PARAMS((long double));
+extern long double powl _PARAMS((long double, long double));
+extern long double sqrtl _PARAMS((long double));
+extern long double fmodl _PARAMS((long double, long double));
+extern long double hypotl _PARAMS((long double, long double));
+#endif /* ! defined (__math_68881) */
+#endif /* ! defined (_REENT_ONLY) */
+extern long double copysignl _PARAMS((long double, long double));
+extern long double nanl _PARAMS((const char *));
+extern int ilogbl _PARAMS((long double));
+extern long double asinhl _PARAMS((long double));
+extern long double cbrtl _PARAMS((long double));
+extern long double nextafterl _PARAMS((long double, long double));
+extern long double rintl _PARAMS((long double));
+extern long double scalbnl _PARAMS((long double, int));
+extern long double exp2l _PARAMS((long double));
+extern long double scalblnl _PARAMS((long double, long));
+extern long double tgammal _PARAMS((long double));
+extern long double nearbyintl _PARAMS((long double));
+extern long int lrintl _PARAMS((long double));
+extern long double roundl _PARAMS((long double));
+extern long lroundl _PARAMS((long double));
+extern _LONG_LONG_TYPE int llroundl _PARAMS((long double));
+extern long double truncl _PARAMS((long double));
+extern long double remquol _PARAMS((long double, long double, int *));
+extern long double fdiml _PARAMS((long double, long double));
+extern long double fmaxl _PARAMS((long double, long double));
+extern long double fminl _PARAMS((long double, long double));
+extern long double fmal _PARAMS((long double, long double, long double));
+#ifndef _REENT_ONLY
+extern long double acoshl _PARAMS((long double));
+extern long double atanhl _PARAMS((long double));
+extern long double remainderl _PARAMS((long double, long double));
+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 /* !_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 /* !_LDBL_EQ_DBL */
#endif /* !defined (__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L */
diff --git a/newlib/libc/include/stdlib.h b/newlib/libc/include/stdlib.h
index e14186586..8f64f09c5 100644
--- a/newlib/libc/include/stdlib.h
+++ b/newlib/libc/include/stdlib.h
@@ -7,6 +7,7 @@
#ifndef _STDLIB_H_
#define _STDLIB_H_
+#include <machine/ieeefp.h>
#include "_ansi.h"
#define __need_size_t
@@ -198,6 +199,12 @@ int _EXFUN(_system_r,(struct _reent *, const char *));
_VOID _EXFUN(__eprintf,(const char *, const char *, unsigned int, const char *));
+/* On platforms where long double is as wide as double. */
+#ifdef _LDBL_EQ_DBL
+extern long double strtold (const char *, char **);
+extern long double wcstold (const wchar_t *, wchar_t **);
+#endif /* LDBL_EQ_DBL */
+
_END_STD_C
#endif /* _STDLIB_H_ */
diff --git a/newlib/libc/stdlib/Makefile.am b/newlib/libc/stdlib/Makefile.am
index a2e87d4bd..38120e6e2 100644
--- a/newlib/libc/stdlib/Makefile.am
+++ b/newlib/libc/stdlib/Makefile.am
@@ -60,6 +60,12 @@ GENERAL_SOURCES = \
wctomb.c \
wctomb_r.c
+if HAVE_LONG_DOUBLE
+GENERAL_SOURCES += \
+ strtold.c \
+ wcstold.c
+endif # HAVE_LONG_DOUBLE
+
EXTENDED_SOURCES = \
cxa_atexit.c \
cxa_finalize.c \
diff --git a/newlib/libc/stdlib/Makefile.in b/newlib/libc/stdlib/Makefile.in
index a719054e5..a47970950 100644
--- a/newlib/libc/stdlib/Makefile.in
+++ b/newlib/libc/stdlib/Makefile.in
@@ -38,7 +38,10 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-LIBOBJDIR =
+@HAVE_LONG_DOUBLE_TRUE@am__append_1 = \
+@HAVE_LONG_DOUBLE_TRUE@ strtold.c \
+@HAVE_LONG_DOUBLE_TRUE@ wcstold.c
+
DIST_COMMON = $(srcdir)/../../Makefile.shared $(srcdir)/Makefile.in \
$(srcdir)/Makefile.am
subdir = stdlib
@@ -67,7 +70,9 @@ am__DEPENDENCIES_2 = $(lpfx)malignr.$(oext) $(lpfx)malloptr.$(oext) \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_2)
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@am__DEPENDENCIES_3 = \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@ $(am__DEPENDENCIES_2)
-am__objects_1 = lib_a-__adjust.$(OBJEXT) lib_a-__atexit.$(OBJEXT) \
+@HAVE_LONG_DOUBLE_TRUE@am__objects_1 = lib_a-strtold.$(OBJEXT) \
+@HAVE_LONG_DOUBLE_TRUE@ lib_a-wcstold.$(OBJEXT)
+am__objects_2 = lib_a-__adjust.$(OBJEXT) lib_a-__atexit.$(OBJEXT) \
lib_a-__call_atexit.$(OBJEXT) lib_a-__exp10.$(OBJEXT) \
lib_a-__ten_mu.$(OBJEXT) lib_a-_Exit.$(OBJEXT) \
lib_a-abort.$(OBJEXT) lib_a-abs.$(OBJEXT) \
@@ -93,8 +98,9 @@ am__objects_1 = lib_a-__adjust.$(OBJEXT) lib_a-__atexit.$(OBJEXT) \
lib_a-strtoul.$(OBJEXT) lib_a-wcstod.$(OBJEXT) \
lib_a-wcstol.$(OBJEXT) lib_a-wcstoul.$(OBJEXT) \
lib_a-wcstombs.$(OBJEXT) lib_a-wcstombs_r.$(OBJEXT) \
- lib_a-wctomb.$(OBJEXT) lib_a-wctomb_r.$(OBJEXT)
-am__objects_2 = lib_a-cxa_atexit.$(OBJEXT) \
+ lib_a-wctomb.$(OBJEXT) lib_a-wctomb_r.$(OBJEXT) \
+ $(am__objects_1)
+am__objects_3 = lib_a-cxa_atexit.$(OBJEXT) \
lib_a-cxa_finalize.$(OBJEXT) lib_a-drand48.$(OBJEXT) \
lib_a-ecvtbuf.$(OBJEXT) lib_a-efgcvt.$(OBJEXT) \
lib_a-erand48.$(OBJEXT) lib_a-jrand48.$(OBJEXT) \
@@ -108,7 +114,7 @@ am__objects_2 = lib_a-cxa_atexit.$(OBJEXT) \
lib_a-wcstoll_r.$(OBJEXT) lib_a-wcstoull.$(OBJEXT) \
lib_a-wcstoull_r.$(OBJEXT) lib_a-atoll.$(OBJEXT) \
lib_a-llabs.$(OBJEXT) lib_a-lldiv.$(OBJEXT)
-am__objects_3 = lib_a-a64l.$(OBJEXT) lib_a-btowc.$(OBJEXT) \
+am__objects_4 = lib_a-a64l.$(OBJEXT) lib_a-btowc.$(OBJEXT) \
lib_a-getopt.$(OBJEXT) lib_a-getsubopt.$(OBJEXT) \
lib_a-l64a.$(OBJEXT) lib_a-malign.$(OBJEXT) \
lib_a-mbrlen.$(OBJEXT) lib_a-mbrtowc.$(OBJEXT) \
@@ -117,21 +123,22 @@ am__objects_3 = lib_a-a64l.$(OBJEXT) lib_a-btowc.$(OBJEXT) \
lib_a-valloc.$(OBJEXT) lib_a-wcrtomb.$(OBJEXT) \
lib_a-wcsnrtombs.$(OBJEXT) lib_a-wcsrtombs.$(OBJEXT) \
lib_a-wctob.$(OBJEXT)
-am__objects_4 = lib_a-putenv.$(OBJEXT) lib_a-putenv_r.$(OBJEXT) \
+am__objects_5 = lib_a-putenv.$(OBJEXT) lib_a-putenv_r.$(OBJEXT) \
lib_a-setenv.$(OBJEXT) lib_a-setenv_r.$(OBJEXT)
-am__objects_5 = lib_a-system.$(OBJEXT)
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@am__objects_6 = $(am__objects_3) \
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ $(am__objects_4) \
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ $(am__objects_5)
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_TRUE@am__objects_6 = $(am__objects_3) \
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_TRUE@ $(am__objects_4)
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@am__objects_6 = \
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@ $(am__objects_3)
-@USE_LIBTOOL_FALSE@am_lib_a_OBJECTS = $(am__objects_1) \
-@USE_LIBTOOL_FALSE@ $(am__objects_2) $(am__objects_6)
+am__objects_6 = lib_a-system.$(OBJEXT)
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@am__objects_7 = $(am__objects_4) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ $(am__objects_5) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ $(am__objects_6)
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_TRUE@am__objects_7 = $(am__objects_4) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_TRUE@ $(am__objects_5)
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@am__objects_7 = \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@ $(am__objects_4)
+@USE_LIBTOOL_FALSE@am_lib_a_OBJECTS = $(am__objects_2) \
+@USE_LIBTOOL_FALSE@ $(am__objects_3) $(am__objects_7)
lib_a_OBJECTS = $(am_lib_a_OBJECTS)
LTLIBRARIES = $(noinst_LTLIBRARIES)
-am__objects_7 = __adjust.lo __atexit.lo __call_atexit.lo __exp10.lo \
+@HAVE_LONG_DOUBLE_TRUE@am__objects_8 = strtold.lo wcstold.lo
+am__objects_9 = __adjust.lo __atexit.lo __call_atexit.lo __exp10.lo \
__ten_mu.lo _Exit.lo abort.lo abs.lo assert.lo atexit.lo \
atof.lo atoff.lo atoi.lo atol.lo calloc.lo div.lo dtoa.lo \
dtoastub.lo environ.lo envlock.lo eprintf.lo exit.lo \
@@ -141,28 +148,28 @@ am__objects_7 = __adjust.lo __atexit.lo __call_atexit.lo __exp10.lo \
mstats.lo rand.lo rand_r.lo realloc.lo reallocf.lo \
sb_charsets.lo strtod.lo strtol.lo strtoul.lo wcstod.lo \
wcstol.lo wcstoul.lo wcstombs.lo wcstombs_r.lo wctomb.lo \
- wctomb_r.lo
-am__objects_8 = cxa_atexit.lo cxa_finalize.lo drand48.lo ecvtbuf.lo \
+ wctomb_r.lo $(am__objects_8)
+am__objects_10 = cxa_atexit.lo cxa_finalize.lo drand48.lo ecvtbuf.lo \
efgcvt.lo erand48.lo jrand48.lo lcong48.lo lrand48.lo \
mrand48.lo msize.lo mtrim.lo nrand48.lo rand48.lo seed48.lo \
srand48.lo strtoll.lo strtoll_r.lo strtoull.lo strtoull_r.lo \
wcstoll.lo wcstoll_r.lo wcstoull.lo wcstoull_r.lo atoll.lo \
llabs.lo lldiv.lo
-am__objects_9 = a64l.lo btowc.lo getopt.lo getsubopt.lo l64a.lo \
+am__objects_11 = a64l.lo btowc.lo getopt.lo getsubopt.lo l64a.lo \
malign.lo mbrlen.lo mbrtowc.lo mbsinit.lo mbsnrtowcs.lo \
mbsrtowcs.lo on_exit.lo valloc.lo wcrtomb.lo wcsnrtombs.lo \
wcsrtombs.lo wctob.lo
-am__objects_10 = putenv.lo putenv_r.lo setenv.lo setenv_r.lo
-am__objects_11 = system.lo
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@am__objects_12 = $(am__objects_9) \
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ $(am__objects_10) \
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ $(am__objects_11)
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_TRUE@am__objects_12 = $(am__objects_9) \
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_TRUE@ $(am__objects_10)
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@am__objects_12 = \
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@ $(am__objects_9)
-@USE_LIBTOOL_TRUE@am_libstdlib_la_OBJECTS = $(am__objects_7) \
-@USE_LIBTOOL_TRUE@ $(am__objects_8) $(am__objects_12)
+am__objects_12 = putenv.lo putenv_r.lo setenv.lo setenv_r.lo
+am__objects_13 = system.lo
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@am__objects_14 = $(am__objects_11) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ $(am__objects_12) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ $(am__objects_13)
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_TRUE@am__objects_14 = $(am__objects_11) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_TRUE@ $(am__objects_12)
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@am__objects_14 = \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@ $(am__objects_11)
+@USE_LIBTOOL_TRUE@am_libstdlib_la_OBJECTS = $(am__objects_9) \
+@USE_LIBTOOL_TRUE@ $(am__objects_10) $(am__objects_14)
libstdlib_la_OBJECTS = $(am_libstdlib_la_OBJECTS)
@USE_LIBTOOL_TRUE@am_libstdlib_la_rpath =
DEFAULT_INCLUDES = -I. -I$(srcdir)
@@ -223,6 +230,8 @@ ENABLE_NEWLIB_ICONV_TRUE = @ENABLE_NEWLIB_ICONV_TRUE@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
+HAVE_LONG_DOUBLE_FALSE = @HAVE_LONG_DOUBLE_FALSE@
+HAVE_LONG_DOUBLE_TRUE = @HAVE_LONG_DOUBLE_TRUE@
HAVE_POSIX_DIR_FALSE = @HAVE_POSIX_DIR_FALSE@
HAVE_POSIX_DIR_TRUE = @HAVE_POSIX_DIR_TRUE@
HAVE_SIGNAL_DIR_FALSE = @HAVE_SIGNAL_DIR_FALSE@
@@ -289,8 +298,20 @@ STRIP = @STRIP@
USE_LIBTOOL_FALSE = @USE_LIBTOOL_FALSE@
USE_LIBTOOL_TRUE = @USE_LIBTOOL_TRUE@
VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_AS = @ac_ct_AS@
ac_ct_CC = @ac_ct_CC@
+ac_ct_DLLTOOL = @ac_ct_DLLTOOL@
+ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_LIPO = @ac_ct_LIPO@
+ac_ct_NMEDIT = @ac_ct_NMEDIT@
+ac_ct_OBJDUMP = @ac_ct_OBJDUMP@
+ac_ct_OTOOL = @ac_ct_OTOOL@
+ac_ct_OTOOL64 = @ac_ct_OTOOL64@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_READELF = @ac_ct_READELF@
+ac_ct_STRIP = @ac_ct_STRIP@
aext = @aext@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
@@ -306,9 +327,6 @@ build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
exec_prefix = @exec_prefix@
extra_dir = @extra_dir@
host = @host@
@@ -316,14 +334,12 @@ host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
-htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
libm_machine_dir = @libm_machine_dir@
-localedir = @localedir@
localstatedir = @localstatedir@
lpfx = @lpfx@
lt_ECHO = @lt_ECHO@
@@ -333,10 +349,8 @@ mkdir_p = @mkdir_p@
newlib_basedir = @newlib_basedir@
oext = @oext@
oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
-psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
subdirs = @subdirs@
@@ -345,62 +359,16 @@ sysconfdir = @sysconfdir@
target_alias = @target_alias@
AUTOMAKE_OPTIONS = cygnus
INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
-GENERAL_SOURCES = \
- __adjust.c \
- __atexit.c \
- __call_atexit.c \
- __exp10.c \
- __ten_mu.c \
- _Exit.c \
- abort.c \
- abs.c \
- assert.c \
- atexit.c \
- atof.c \
- atoff.c \
- atoi.c \
- atol.c \
- calloc.c \
- div.c \
- dtoa.c \
- dtoastub.c \
- environ.c \
- envlock.c \
- eprintf.c \
- exit.c \
- gdtoa-gethex.c \
- gdtoa-hexnan.c \
- getenv.c \
- getenv_r.c \
- labs.c \
- ldiv.c \
- ldtoa.c \
- malloc.c \
- mblen.c \
- mblen_r.c \
- mbstowcs.c \
- mbstowcs_r.c \
- mbtowc.c \
- mbtowc_r.c \
- mlock.c \
- mprec.c \
- mstats.c \
- rand.c \
- rand_r.c \
- realloc.c \
- reallocf.c \
- sb_charsets.c \
- strtod.c \
- strtol.c \
- strtoul.c \
- wcstod.c \
- wcstol.c \
- wcstoul.c \
- wcstombs.c \
- wcstombs_r.c \
- wctomb.c \
- wctomb_r.c
-
+GENERAL_SOURCES = __adjust.c __atexit.c __call_atexit.c __exp10.c \
+ __ten_mu.c _Exit.c abort.c abs.c assert.c atexit.c atof.c \
+ atoff.c atoi.c atol.c calloc.c div.c dtoa.c dtoastub.c \
+ environ.c envlock.c eprintf.c exit.c gdtoa-gethex.c \
+ gdtoa-hexnan.c getenv.c getenv_r.c labs.c ldiv.c ldtoa.c \
+ malloc.c mblen.c mblen_r.c mbstowcs.c mbstowcs_r.c mbtowc.c \
+ mbtowc_r.c mlock.c mprec.c mstats.c rand.c rand_r.c realloc.c \
+ reallocf.c sb_charsets.c strtod.c strtol.c strtoul.c wcstod.c \
+ wcstol.c wcstoul.c wcstombs.c wcstombs_r.c wctomb.c wctomb_r.c \
+ $(am__append_1)
EXTENDED_SOURCES = \
cxa_atexit.c \
cxa_finalize.c \
@@ -936,6 +904,18 @@ lib_a-wctomb_r.o: wctomb_r.c
lib_a-wctomb_r.obj: wctomb_r.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wctomb_r.obj `if test -f 'wctomb_r.c'; then $(CYGPATH_W) 'wctomb_r.c'; else $(CYGPATH_W) '$(srcdir)/wctomb_r.c'; fi`
+lib_a-strtold.o: strtold.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strtold.o `test -f 'strtold.c' || echo '$(srcdir)/'`strtold.c
+
+lib_a-strtold.obj: strtold.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strtold.obj `if test -f 'strtold.c'; then $(CYGPATH_W) 'strtold.c'; else $(CYGPATH_W) '$(srcdir)/strtold.c'; fi`
+
+lib_a-wcstold.o: wcstold.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcstold.o `test -f 'wcstold.c' || echo '$(srcdir)/'`wcstold.c
+
+lib_a-wcstold.obj: wcstold.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcstold.obj `if test -f 'wcstold.c'; then $(CYGPATH_W) 'wcstold.c'; else $(CYGPATH_W) '$(srcdir)/wcstold.c'; fi`
+
lib_a-cxa_atexit.o: cxa_atexit.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-cxa_atexit.o `test -f 'cxa_atexit.c' || echo '$(srcdir)/'`cxa_atexit.c
@@ -1237,7 +1217,7 @@ clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
- -rm -f libtool config.lt
+ -rm -f libtool
uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
diff --git a/newlib/libc/stdlib/strtold.c b/newlib/libc/stdlib/strtold.c
new file mode 100644
index 000000000..2abd084a9
--- /dev/null
+++ b/newlib/libc/stdlib/strtold.c
@@ -0,0 +1,41 @@
+/*
+(C) Copyright IBM Corp. 2009
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+* Neither the name of IBM nor the names of its contributors may be
+used to endorse or promote products derived from this software without
+specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdlib.h>
+
+/* On platforms where long double is as wide as double. */
+#ifdef _LDBL_EQ_DBL
+long double
+strtold (const char *s00, char **se)
+{
+ return strtod(s00, se);
+}
+#endif /* _LDBL_EQ_DBL */
+
diff --git a/newlib/libc/stdlib/wcstold.c b/newlib/libc/stdlib/wcstold.c
new file mode 100644
index 000000000..6c8a422bb
--- /dev/null
+++ b/newlib/libc/stdlib/wcstold.c
@@ -0,0 +1,41 @@
+/*
+(C) Copyright IBM Corp. 2009
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+* Neither the name of IBM nor the names of its contributors may be
+used to endorse or promote products derived from this software without
+specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <stdlib.h>
+
+/* On platforms where long double is as wide as double. */
+#ifdef _LDBL_EQ_DBL
+long double
+wcstold (const wchar_t *nptr, wchar_t **endptr)
+{
+ return wcstod(nptr, endptr);
+}
+#endif /* _LDBL_EQ_DBL */
+