diff options
author | Michal Kazior <kazikcz@gmail.com> | 2020-07-25 16:58:33 +0200 |
---|---|---|
committer | Michal Kazior <kazikcz@gmail.com> | 2020-07-25 19:19:16 +0200 |
commit | c200c851e40cdeeb1d8d5856683076113cb8e039 (patch) | |
tree | 3db64acff1182f613d42e259de7047b0d7a07e93 | |
parent | 86d4db218e92bcf82e63698f214c0c628ebd982b (diff) | |
download | gcompat-c200c851e40cdeeb1d8d5856683076113cb8e039.tar.gz gcompat-c200c851e40cdeeb1d8d5856683076113cb8e039.tar.bz2 gcompat-c200c851e40cdeeb1d8d5856683076113cb8e039.tar.xz gcompat-c200c851e40cdeeb1d8d5856683076113cb8e039.zip |
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 <kazikcz@gmail.com>
-rw-r--r-- | libgcompat/wchar.c | 11 |
1 files changed, 11 insertions, 0 deletions
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); +} |