From c200c851e40cdeeb1d8d5856683076113cb8e039 Mon Sep 17 00:00:00 2001 From: Michal Kazior Date: Sat, 25 Jul 2020 16:58:33 +0200 Subject: wchar: implement wcstol_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 --- libgcompat/wchar.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libgcompat/wchar.c b/libgcompat/wchar.c index c017582..0d53e88 100644 --- a/libgcompat/wchar.c +++ b/libgcompat/wchar.c @@ -114,3 +114,14 @@ unsigned long int wcstoul_l(const wchar_t *nptr, wchar_t **endptr, { return wcstoul(nptr, endptr, base); } + +/** + * Convert a wide-character string to a long int. + * + * Some day, when musl supports LC_NUMERIC, we can probably remove this. + */ +long int wcstol_l(const wchar_t *nptr, wchar_t **endptr, int base, + locale_t loc) +{ + return wcstol(nptr, endptr, base); +} -- cgit v1.2.3-70-g09d2