From b611b59a18827dab641cdef54d2d998d36c7c7f6 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 15 Oct 2017 09:07:22 -0500 Subject: string: add strto[u?]ll_l 'locale-aware' methods --- libgcompat/string.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libgcompat/string.c b/libgcompat/string.c index 9a1cb60..9045d5d 100644 --- a/libgcompat/string.c +++ b/libgcompat/string.c @@ -1,5 +1,6 @@ #include /* assert */ #include /* memcpy, strcpy, strncat, strndup */ +#include /* strto[u?]ll */ /* "Checked" memcpy */ void *__memcpy_chk(void *dest, const void *src, size_t len, size_t destlen) @@ -82,3 +83,14 @@ char *__strsep_g(char **stringp, const char *delim) { return strsep(stringp, delim); } + +/* Some day, when musl supports LC_NUMERIC, we can probably remove these */ +long long int strtoll_l(const char *nptr, char **endptr, int base, locale_t locale) +{ + return strtoll(nptr, endptr, base); +} + +unsigned long long int strtoull_l(const char *nptr, char **endptr, int base, locale_t locale) +{ + return strtoull(nptr, endptr, base); +} -- cgit v1.2.3-70-g09d2