From e1477898d0203dae4b2fe9ad62998bc27d4b4fc9 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Wed, 27 Feb 2019 19:17:39 -0500 Subject: add common _strtoi function body --- src/wchar/wcstol.c | 11 +++++++++-- src/wchar/wcstoll.c | 9 +++++++++ src/wchar/wcstoul.c | 11 +++++++++-- src/wchar/wcstoull.c | 9 +++++++++ 4 files changed, 36 insertions(+), 4 deletions(-) (limited to 'src/wchar') diff --git a/src/wchar/wcstol.c b/src/wchar/wcstol.c index 5d4a605d..d349ee9c 100644 --- a/src/wchar/wcstol.c +++ b/src/wchar/wcstol.c @@ -1,9 +1,16 @@ #include +#include "limits.h" +#include "errno.h" long int wcstol(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base) { - (void)nptr; (void)endptr; (void)base; - return 0L; + long int ret = 0; + long int max = LONG_MAX; + long int min = LONG_MIN; + + #include "../stdlib/_strtoi.h" + + return ret; } /* diff --git a/src/wchar/wcstoll.c b/src/wchar/wcstoll.c index fc231433..60c4a475 100644 --- a/src/wchar/wcstoll.c +++ b/src/wchar/wcstoll.c @@ -1,7 +1,16 @@ #include +#include "limits.h" +#include "errno.h" long long int wcstoll(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base) { + long long int ret = 0; + long long int max = LLONG_MAX; + long long int min = LLONG_MIN; + + #include "../stdlib/_strtoi.h" + + return ret; } /* diff --git a/src/wchar/wcstoul.c b/src/wchar/wcstoul.c index 8fcaeb8e..f8373c05 100644 --- a/src/wchar/wcstoul.c +++ b/src/wchar/wcstoul.c @@ -1,9 +1,16 @@ #include +#include "limits.h" +#include "errno.h" unsigned long int wcstoul(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base) { - (void)nptr; (void)endptr; (void)base; - return 0UL; + unsigned long int ret = 0; + unsigned long int max = ULONG_MAX; + unsigned long int min = 0; + + #include "../stdlib/_strtoi.h" + + return ret; } /* diff --git a/src/wchar/wcstoull.c b/src/wchar/wcstoull.c index 92e12e59..632ff2e9 100644 --- a/src/wchar/wcstoull.c +++ b/src/wchar/wcstoull.c @@ -1,7 +1,16 @@ #include +#include "limits.h" +#include "errno.h" unsigned long long int wcstoull(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base) { + unsigned long long int ret = 0; + unsigned long long int max = ULLONG_MAX; + unsigned long long int min = 0; + + #include "../stdlib/_strtoi.h" + + return ret; } /* -- cgit v1.2.1