From de7d36016f9976d22fdfc8487702edcc92cdd096 Mon Sep 17 00:00:00 2001
From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 10 Nov 2006 15:50:39 +0000
Subject: [PATCH] 	* config/locale/gnu/c_locale.cc (__convert_to_v):
 Prefer 	strtold_l over __strtold_l if available.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118654 138bc75d-0d04-0410-961f-82ee72b054a4
---
 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 e0ee3438ad00..bf13f595b5ac 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -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
diff --git a/libstdc++-v3/config/locale/gnu/c_locale.cc b/libstdc++-v3/config/locale/gnu/c_locale.cc
index 8a42638e0f28..37db702677a3 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
-- 
GitLab