summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Kazior <kazikcz@gmail.com>2020-07-25 16:58:43 +0200
committerMichal Kazior <kazikcz@gmail.com>2020-07-25 19:19:16 +0200
commit93b7fedb31b6086d2b9fd966cb8bf17430a9a515 (patch)
treebc97f855da1d3bad06d93d97a127ad07687a81e9
parentc200c851e40cdeeb1d8d5856683076113cb8e039 (diff)
downloadgcompat-93b7fedb31b6086d2b9fd966cb8bf17430a9a515.tar.gz
gcompat-93b7fedb31b6086d2b9fd966cb8bf17430a9a515.tar.bz2
gcompat-93b7fedb31b6086d2b9fd966cb8bf17430a9a515.tar.xz
gcompat-93b7fedb31b6086d2b9fd966cb8bf17430a9a515.zip
wchar: implement wcstod_l
This is similar to strtoll_l() in a way it ignores the locale_t argument and uses the global locale settings. Signed-off-by: Michal Kazior <kazikcz@gmail.com>
-rw-r--r--libgcompat/wchar.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libgcompat/wchar.c b/libgcompat/wchar.c
index 0d53e88..930cc7c 100644
--- a/libgcompat/wchar.c
+++ b/libgcompat/wchar.c
@@ -125,3 +125,13 @@ long int wcstol_l(const wchar_t *nptr, wchar_t **endptr, int base,
{
return wcstol(nptr, endptr, base);
}
+
+/**
+ * Convert a wide-character string to a double.
+ *
+ * Some day, when musl supports LC_NUMERIC, we can probably remove this.
+ */
+double wcstod_l(const wchar_t *nptr, wchar_t **endptr, locale_t loc)
+{
+ return wcstod(nptr, endptr);
+}