From 29520adf7d46186470718cbd7d277db6c85ac0be Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 10 Nov 2006 16:50:39 +0100 Subject: [PATCH] c_locale.cc (__convert_to_v): Prefer strtold_l over __strtold_l if available. * config/locale/gnu/c_locale.cc (__convert_to_v): Prefer strtold_l over __strtold_l if available. From-SVN: r118654 --- libstdc++-v3/ChangeLog | 5 +++++ libstdc++-v3/config/locale/gnu/c_locale.cc | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index e0ee3438ad0..bf13f595b5a 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2006-11-10 Jakub Jelinek + + * config/locale/gnu/c_locale.cc (__convert_to_v): Prefer + strtold_l over __strtold_l if available. + 2006-11-07 Benjamin Kosnik PR libstdc++/29722 diff --git a/libstdc++-v3/config/locale/gnu/c_locale.cc b/libstdc++-v3/config/locale/gnu/c_locale.cc index 8a42638e0f2..37db702677a 100644 --- a/libstdc++-v3/config/locale/gnu/c_locale.cc +++ b/libstdc++-v3/config/locale/gnu/c_locale.cc @@ -77,7 +77,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std) { char* __sanity; errno = 0; +#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) + // Prefer strtold_l, as __strtold_l isn't prototyped in more recent + // glibc versions. + long double __ld = strtold_l(__s, &__sanity, __cloc); +#else long double __ld = __strtold_l(__s, &__sanity, __cloc); +#endif if (__sanity != __s && errno != ERANGE) __v = __ld; else