summaryrefslogtreecommitdiff
path: root/libgcompat
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2017-10-15 09:07:22 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2017-10-15 09:07:22 -0500
commitb611b59a18827dab641cdef54d2d998d36c7c7f6 (patch)
treee631e6f42fdc0329f0258bf3837e273fd6a784bc /libgcompat
parent58853c42be77a99f6a6221fc630e516753bc10e5 (diff)
downloadgcompat-b611b59a18827dab641cdef54d2d998d36c7c7f6.tar.gz
gcompat-b611b59a18827dab641cdef54d2d998d36c7c7f6.tar.bz2
gcompat-b611b59a18827dab641cdef54d2d998d36c7c7f6.tar.xz
gcompat-b611b59a18827dab641cdef54d2d998d36c7c7f6.zip
string: add strto[u?]ll_l 'locale-aware' methods
Diffstat (limited to 'libgcompat')
-rw-r--r--libgcompat/string.c12
1 files changed, 12 insertions, 0 deletions
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.h> /* assert */
#include <string.h> /* memcpy, strcpy, strncat, strndup */
+#include <stdlib.h> /* 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);
+}