]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c_locale.cc (__convert_to_v): Prefer strtold_l over __strtold_l if available.
authorJakub Jelinek <jakub@redhat.com>
Fri, 10 Nov 2006 15:50:39 +0000 (16:50 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 10 Nov 2006 15:50:39 +0000 (16:50 +0100)
* config/locale/gnu/c_locale.cc (__convert_to_v): Prefer
strtold_l over __strtold_l if available.

From-SVN: r118654

libstdc++-v3/ChangeLog
libstdc++-v3/config/locale/gnu/c_locale.cc

index e0ee3438ad00d3c07ef2c79d5727cf5eff5d967e..bf13f595b5ac8cce1cb6c49c35c2987f4ab11d0b 100644 (file)
@@ -1,3 +1,8 @@
+2006-11-10  Jakub Jelinek  <jakub@redhat.com>
+
+       * config/locale/gnu/c_locale.cc (__convert_to_v): Prefer
+       strtold_l over __strtold_l if available.
+
 2006-11-07  Benjamin Kosnik  <bkoz@redhat.com>
 
        PR libstdc++/29722
index 8a42638e0f28fb4a8a2abe771100273f2b92d9ef..37db702677a386734e46607aa50a9089f18e33f0 100644 (file)
@@ -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