123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044 |
- #include <limits.h>
- #include <stdint.h>
- #include <stdint.h>
- #include <inttypes.h>
- #include <ctype.h>
- #include <errno.h>
- #include <assert.h>
- #include <unistd.h>
- #include <stdlib.h>
- #include <locale.h>
- #ifdef __UCLIBC_HAS_WCHAR__
- #include <wchar.h>
- #include <wctype.h>
- #include <bits/uClibc_uwchar.h>
- #if WCHAR_MAX > 0xffffUL
- #define UTF_8_MAX_LEN 6
- #else
- #define UTF_8_MAX_LEN 3
- #endif
- #ifdef __UCLIBC_HAS_LOCALE__
- #define ENCODING (__UCLIBC_CURLOCALE->encoding)
- #ifndef __CTYPE_HAS_UTF_8_LOCALES
- #ifdef L_mblen
- #warning __CTYPE_HAS_UTF_8_LOCALES not set!
- #endif
- #endif
- #else
- #ifdef __CTYPE_HAS_8_BIT_LOCALES
- #error __CTYPE_HAS_8_BIT_LOCALES is defined!
- #endif
- #ifdef __CTYPE_HAS_UTF_8_LOCALES
- #error __CTYPE_HAS_UTF_8_LOCALES is defined!
- #endif
- #endif
- #endif
- #ifdef __UCLIBC_HAS_XLOCALE__
- extern unsigned long
- _stdlib_strto_l_l(register const char * __restrict str,
- char ** __restrict endptr, int base, int sflag,
- __locale_t locale_arg) attribute_hidden;
- #if defined(ULLONG_MAX)
- extern unsigned long long
- _stdlib_strto_ll_l(register const char * __restrict str,
- char ** __restrict endptr, int base, int sflag,
- __locale_t locale_arg) attribute_hidden;
- #endif
- #ifdef __UCLIBC_HAS_WCHAR__
- extern unsigned long
- _stdlib_wcsto_l_l(register const wchar_t * __restrict str,
- wchar_t ** __restrict endptr, int base, int sflag,
- __locale_t locale_arg) attribute_hidden;
- #if defined(ULLONG_MAX)
- extern unsigned long long
- _stdlib_wcsto_ll_l(register const wchar_t * __restrict str,
- wchar_t ** __restrict endptr, int base, int sflag,
- __locale_t locale_arg) attribute_hidden;
- #endif
- #endif
- #endif
- extern unsigned long
- _stdlib_strto_l(register const char * __restrict str,
- char ** __restrict endptr, int base, int sflag) attribute_hidden;
- #if defined(ULLONG_MAX)
- extern unsigned long long
- _stdlib_strto_ll(register const char * __restrict str,
- char ** __restrict endptr, int base, int sflag) attribute_hidden;
- #endif
- #ifdef __UCLIBC_HAS_WCHAR__
- extern unsigned long
- _stdlib_wcsto_l(register const wchar_t * __restrict str,
- wchar_t ** __restrict endptr, int base, int sflag) attribute_hidden;
- #if defined(ULLONG_MAX)
- extern unsigned long long
- _stdlib_wcsto_ll(register const wchar_t * __restrict str,
- wchar_t ** __restrict endptr, int base, int sflag) attribute_hidden;
- #endif
- #endif
- #ifdef L_atof
- double atof(const char *nptr)
- {
- return strtod(nptr, (char **) NULL);
- }
- #endif
- #ifdef L_abs
- #if INT_MAX < LONG_MAX
- int abs(int j)
- {
- return (j >= 0) ? j : -j;
- }
- #endif
- #endif
- #ifdef L_labs
- long int labs(long int j)
- {
- return (j >= 0) ? j : -j;
- }
- #if UINT_MAX == ULONG_MAX
- strong_alias_untyped(labs,abs)
- #endif
- #if defined(ULLONG_MAX) && (ULLONG_MAX == ULONG_MAX)
- strong_alias_untyped(labs,llabs)
- #endif
- #if ULONG_MAX == UINTMAX_MAX
- strong_alias_untyped(labs,imaxabs)
- #endif
- #endif
- #ifdef L_llabs
- #if defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX)
- long long int llabs(long long int j)
- {
- return (j >= 0) ? j : -j;
- }
- #if (ULLONG_MAX == UINTMAX_MAX)
- strong_alias_untyped(llabs,imaxabs)
- #endif
- #endif
- #endif
- #ifdef L_atoi
- #if INT_MAX < LONG_MAX
- int atoi(const char *nptr)
- {
- return (int) strtol(nptr, (char **) NULL, 10);
- }
- libc_hidden_def(atoi)
- #endif
- #endif
- #ifdef L_atol
- long atol(const char *nptr)
- {
- return strtol(nptr, (char **) NULL, 10);
- }
- #if UINT_MAX == ULONG_MAX
- strong_alias_untyped(atol,atoi)
- libc_hidden_def(atoi)
- #endif
- #if defined(ULLONG_MAX) && (ULLONG_MAX == ULONG_MAX)
- strong_alias_untyped(atol,atoll)
- #endif
- #endif
- #ifdef L_atoll
- #if defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX)
- long long atoll(const char *nptr)
- {
- return strtoll(nptr, (char **) NULL, 10);
- }
- #endif
- #endif
- #ifdef L_rpmatch
- int rpmatch (const char *__response)
- {
- return (__response[0] == 'y' || __response[0] == 'Y') ? 1 :
- (__response[0] == 'n' || __response[0] == 'N') ? 0 : -1;
- }
- #endif
- #if defined(L_strtol) || defined(L_strtol_l)
- long __XL_NPP(strtol)(const char * __restrict str, char ** __restrict endptr,
- int base __LOCALE_PARAM)
- {
- return __XL_NPP(_stdlib_strto_l)(str, endptr, base, 1 __LOCALE_ARG);
- }
- libc_hidden_def(__XL_NPP(strtol))
- #if (ULONG_MAX == UINTMAX_MAX) && !defined(L_strtol_l)
- strong_alias(strtol,strtoimax)
- #endif
- #if defined(ULLONG_MAX) && (ULLONG_MAX == ULONG_MAX)
- strong_alias_untyped(__XL_NPP(strtol),__XL_NPP(strtoll))
- #ifdef L_strtol
- libc_hidden_def(__XL_NPP(strtoll))
- strong_alias(strtol,strtoq)
- #endif
- #endif
- #endif
- #if defined(L_strtoll) || defined(L_strtoll_l)
- #if defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX)
- long long __XL_NPP(strtoll)(const char * __restrict str,
- char ** __restrict endptr, int base
- __LOCALE_PARAM)
- {
- return (long long) __XL_NPP(_stdlib_strto_ll)(str, endptr, base, 1 __LOCALE_ARG);
- }
- #ifdef L_strtoll
- libc_hidden_def(__XL_NPP(strtoll))
- #if (ULLONG_MAX == UINTMAX_MAX)
- strong_alias(strtoll,strtoimax)
- #endif
- strong_alias(strtoll,strtoq)
- #endif
- #endif
- #endif
- #if defined(L_strtoul) || defined(L_strtoul_l)
- unsigned long __XL_NPP(strtoul)(const char * __restrict str,
- char ** __restrict endptr, int base
- __LOCALE_PARAM)
- {
- return __XL_NPP(_stdlib_strto_l)(str, endptr, base, 0 __LOCALE_ARG);
- }
- libc_hidden_def(__XL_NPP(strtoul))
- #if (ULONG_MAX == UINTMAX_MAX) && !defined(L_strtoul_l)
- strong_alias(strtoul,strtoumax)
- #endif
- #if defined(ULLONG_MAX) && (ULLONG_MAX == ULONG_MAX)
- strong_alias_untyped(__XL_NPP(strtoul),__XL_NPP(strtoull))
- #if !defined(L_strtoul_l)
- strong_alias(strtoul,strtouq)
- #endif
- #endif
- #endif
- #if defined(L_strtoull) || defined(L_strtoull_l)
- #if defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX)
- unsigned long long __XL_NPP(strtoull)(const char * __restrict str,
- char ** __restrict endptr, int base
- __LOCALE_PARAM)
- {
- return __XL_NPP(_stdlib_strto_ll)(str, endptr, base, 0 __LOCALE_ARG);
- }
- #if !defined(L_strtoull_l)
- #if (ULLONG_MAX == UINTMAX_MAX)
- strong_alias(strtoull,strtoumax)
- #endif
- strong_alias(strtoull,strtouq)
- #endif
- #endif
- #endif
- #define _STRTO_ERRNO 1
- #define _STRTO_ENDPTR 1
- #if _STRTO_ERRNO
- #undef _STRTO_ENDPTR
- #define _STRTO_ENDPTR 1
- #define SET_ERRNO(X) __set_errno(X)
- #else
- #define SET_ERRNO(X) ((void)(X))
- #endif
- #if defined(L__stdlib_wcsto_l) || defined(L__stdlib_wcsto_l_l)
- #ifndef L__stdlib_strto_l
- #define L__stdlib_strto_l
- #endif
- #endif
- #if defined(L__stdlib_strto_l) || defined(L__stdlib_strto_l_l)
- #if defined(L__stdlib_wcsto_l) || defined(L__stdlib_wcsto_l_l)
- #define _stdlib_strto_l _stdlib_wcsto_l
- #define _stdlib_strto_l_l _stdlib_wcsto_l_l
- #define Wchar wchar_t
- #define Wuchar __uwchar_t
- #ifdef __UCLIBC_DO_XLOCALE
- #define ISSPACE(C) iswspace_l((C), locale_arg)
- #else
- #define ISSPACE(C) iswspace((C))
- #endif
- #else
- #define Wchar char
- #define Wuchar unsigned char
- #ifdef __UCLIBC_DO_XLOCALE
- #define ISSPACE(C) isspace_l((C), locale_arg)
- #else
- #define ISSPACE(C) isspace((C))
- #endif
- #endif
- #if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE)
- unsigned long attribute_hidden _stdlib_strto_l(register const Wchar * __restrict str,
- Wchar ** __restrict endptr, int base,
- int sflag)
- {
- return _stdlib_strto_l_l(str, endptr, base, sflag, __UCLIBC_CURLOCALE);
- }
- #else
- unsigned long attribute_hidden __XL_NPP(_stdlib_strto_l)(register const Wchar * __restrict str,
- Wchar ** __restrict endptr, int base,
- int sflag __LOCALE_PARAM)
- {
- unsigned long number, cutoff;
- #if _STRTO_ENDPTR
- const Wchar *fail_char;
- #define SET_FAIL(X) fail_char = (X)
- #else
- #define SET_FAIL(X) ((void)(X))
- #endif
- unsigned char negative, digit, cutoff_digit;
- assert(((unsigned int)sflag) <= 1);
- SET_FAIL(str);
- while (ISSPACE(*str)) {
- ++str;
- }
-
- negative = 0;
- switch (*str) {
- case '-': negative = 1;
- case '+': ++str;
- }
- if (!(base & ~0x10)) {
- base += 10;
- if (*str == '0') {
- SET_FAIL(++str);
- base -= 2;
- if ((0x20|(*str)) == 'x') {
- ++str;
- base += base;
- }
- }
- if (base > 16) {
- base = 16;
- }
- }
- number = 0;
- if (((unsigned)(base - 2)) < 35) {
- cutoff_digit = ULONG_MAX % base;
- cutoff = ULONG_MAX / base;
- do {
- digit = ((Wuchar)(*str - '0') <= 9)
- ? (*str - '0')
- : (((Wuchar)(0x20 | *str) >= 'a')
- ? ((Wuchar)(0x20 | *str) - ('a' - 10))
- : 40 );
- if (digit >= base) {
- break;
- }
- SET_FAIL(++str);
- if ((number > cutoff)
- || ((number == cutoff) && (digit > cutoff_digit))) {
- number = ULONG_MAX;
- negative &= sflag;
- SET_ERRNO(ERANGE);
- } else {
- number = number * base + digit;
- }
- } while (1);
- }
- #if _STRTO_ENDPTR
- if (endptr) {
- *endptr = (Wchar *) fail_char;
- }
- #endif
- {
- unsigned long tmp = (negative
- ? ((unsigned long)(-(1+LONG_MIN)))+1
- : LONG_MAX);
- if (sflag && (number > tmp)) {
- number = tmp;
- SET_ERRNO(ERANGE);
- }
- }
- return negative ? (unsigned long)(-((long)number)) : number;
- }
- #endif
- #endif
- #if defined(L__stdlib_wcsto_ll) || defined(L__stdlib_wcsto_ll_l)
- #ifndef L__stdlib_strto_ll
- #define L__stdlib_strto_ll
- #endif
- #endif
- #if defined(L__stdlib_strto_ll) || defined(L__stdlib_strto_ll_l)
- #if defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX)
- #if defined(L__stdlib_wcsto_ll) || defined(L__stdlib_wcsto_ll_l)
- #define _stdlib_strto_ll _stdlib_wcsto_ll
- #define _stdlib_strto_ll_l _stdlib_wcsto_ll_l
- #define Wchar wchar_t
- #define Wuchar __uwchar_t
- #ifdef __UCLIBC_DO_XLOCALE
- #define ISSPACE(C) iswspace_l((C), locale_arg)
- #else
- #define ISSPACE(C) iswspace((C))
- #endif
- #else
- #define Wchar char
- #define Wuchar unsigned char
- #ifdef __UCLIBC_DO_XLOCALE
- #define ISSPACE(C) isspace_l((C), locale_arg)
- #else
- #define ISSPACE(C) isspace((C))
- #endif
- #endif
- #if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE)
- unsigned long long attribute_hidden _stdlib_strto_ll(register const Wchar * __restrict str,
- Wchar ** __restrict endptr, int base,
- int sflag)
- {
- return _stdlib_strto_ll_l(str, endptr, base, sflag, __UCLIBC_CURLOCALE);
- }
- #else
- unsigned long long attribute_hidden __XL_NPP(_stdlib_strto_ll)(register const Wchar * __restrict str,
- Wchar ** __restrict endptr, int base,
- int sflag __LOCALE_PARAM)
- {
- unsigned long long number;
- #if _STRTO_ENDPTR
- const Wchar *fail_char;
- #define SET_FAIL(X) fail_char = (X)
- #else
- #define SET_FAIL(X) ((void)(X))
- #endif
- unsigned int n1;
- unsigned char negative, digit;
- assert(((unsigned int)sflag) <= 1);
- SET_FAIL(str);
- while (ISSPACE(*str)) {
- ++str;
- }
-
- negative = 0;
- switch (*str) {
- case '-': negative = 1;
- case '+': ++str;
- }
- if (!(base & ~0x10)) {
- base += 10;
- if (*str == '0') {
- SET_FAIL(++str);
- base -= 2;
- if ((0x20|(*str)) == 'x') {
- ++str;
- base += base;
- }
- }
- if (base > 16) {
- base = 16;
- }
- }
- number = 0;
- if (((unsigned)(base - 2)) < 35) {
- do {
- digit = ((Wuchar)(*str - '0') <= 9)
- ? (*str - '0')
- : (((Wuchar)(0x20 | *str) >= 'a')
- ? ((Wuchar)(0x20 | *str) - ('a' - 10))
- : 40 );
- if (digit >= base) {
- break;
- }
- SET_FAIL(++str);
- #if 1
-
- if (number <= (ULLONG_MAX >> 6)) {
- number = number * base + digit;
- } else
- #endif
- {
- n1 = ((unsigned char) number) * base + digit;
- number = (number >> CHAR_BIT) * base;
- if (number + (n1 >> CHAR_BIT) <= (ULLONG_MAX >> CHAR_BIT)) {
- number = (number << CHAR_BIT) + n1;
- } else {
- number = ULLONG_MAX;
- negative &= sflag;
- SET_ERRNO(ERANGE);
- }
- }
- } while (1);
- }
- #if _STRTO_ENDPTR
- if (endptr) {
- *endptr = (Wchar *) fail_char;
- }
- #endif
- {
- unsigned long long tmp = ((negative)
- ? ((unsigned long long)(-(1+LLONG_MIN)))+1
- : LLONG_MAX);
- if (sflag && (number > tmp)) {
- number = tmp;
- SET_ERRNO(ERANGE);
- }
- }
- return negative ? (unsigned long long)(-((long long)number)) : number;
- }
- #endif
- #endif
- #endif
- #ifdef L_bsearch
- void *bsearch(const void *key, const void *base, size_t high,
- size_t size, int (*compar)(const void *, const void *))
- {
- register char *p;
- size_t low;
- size_t mid;
- int r;
- if (size > 0) {
- low = 0;
- while (low < high) {
- mid = low + ((high - low) >> 1);
- p = ((char *)base) + mid * size;
- r = (*compar)(key, p);
- if (r > 0) {
- low = mid + 1;
- } else if (r < 0) {
- high = mid;
- } else {
- return p;
- }
- }
- }
- return NULL;
- }
- #endif
- #ifdef L_qsort_r
- void qsort_r(void *base,
- size_t nel,
- size_t width,
- __compar_d_fn_t comp,
- void *arg)
- {
- size_t wgap, i, j, k;
- char tmp;
- if ((nel > 1) && (width > 0)) {
- assert(nel <= ((size_t)(-1)) / width);
- wgap = 0;
- do {
- wgap = 3 * wgap + 1;
- } while (wgap < (nel-1)/3);
-
-
- wgap *= width;
- nel *= width;
- do {
- i = wgap;
- do {
- j = i;
- do {
- register char *a;
- register char *b;
- j -= wgap;
- a = j + ((char *)base);
- b = a + wgap;
- if ((*comp)(a, b, arg) <= 0) {
- break;
- }
- k = width;
- do {
- tmp = *a;
- *a++ = *b;
- *b++ = tmp;
- } while (--k);
- } while (j >= wgap);
- i += width;
- } while (i < nel);
- wgap = (wgap - width)/3;
- } while (wgap);
- }
- }
- libc_hidden_def(qsort_r)
- #if 0
- #include <stddef.h>
- void ssort(void *base,
- size_t nel,
- size_t width,
- int (*comp)(const void *, const void *))
- {
- size_t wnel, gap, wgap, i, j, k;
- char *a, *b, tmp;
- wnel = width * nel;
- for (gap = 0; ++gap < nel;)
- gap *= 3;
- while ((gap /= 3) != 0) {
- wgap = width * gap;
- for (i = wgap; i < wnel; i += width) {
- for (j = i - wgap; ;j -= wgap) {
- a = j + (char *)base;
- b = a + wgap;
- if ((*comp)(a, b) <= 0)
- break;
- k = width;
- do {
- tmp = *a;
- *a++ = *b;
- *b++ = tmp;
- } while (--k);
- if (j < wgap)
- break;
- }
- }
- }
- }
- #endif
- #endif
- #ifdef L_qsort
- void qsort(void *base,
- size_t nel,
- size_t width,
- __compar_fn_t comp)
- {
- return qsort_r (base, nel, width, (__compar_d_fn_t) comp, NULL);
- }
- libc_hidden_def(qsort)
- #endif
- #ifdef L__stdlib_mb_cur_max
- size_t _stdlib_mb_cur_max(void)
- {
- #ifdef __CTYPE_HAS_UTF_8_LOCALES
- return __UCLIBC_CURLOCALE->mb_cur_max;
- #else
- return 1;
- #endif
- }
- libc_hidden_def(_stdlib_mb_cur_max)
- #endif
- #ifdef __UCLIBC_HAS_LOCALE__
- static __always_inline int is_stateful(unsigned char encoding)
- {
- switch (encoding)
- {
- case __ctype_encoding_7_bit:
- case __ctype_encoding_utf8:
- case __ctype_encoding_8_bit:
- return 0;
- default:
- assert(0);
- return -1;
- }
- }
- #else
- #define is_stateful(encoding) 0
- #endif
- #ifdef L_mblen
- int mblen(register const char *s, size_t n)
- {
- static mbstate_t state;
- size_t r;
- if (!s) {
- state.__mask = 0;
-
- return is_stateful(ENCODING);
- }
- if (*s == '\0')
-
- return 0;
- if ((r = mbrlen(s, n, &state)) == (size_t) -2) {
-
- state.__wc = 0xffffU;
- return -1;
- }
- return r;
- }
- #endif
- #ifdef L_mbtowc
- int mbtowc(wchar_t *__restrict pwc, register const char *__restrict s, size_t n)
- {
- static mbstate_t state;
- size_t r;
- if (!s) {
- state.__mask = 0;
-
- return is_stateful(ENCODING);
- }
- if (*s == '\0') {
-
-
- if (pwc != NULL)
- *pwc = L'\0';
- return 0;
- }
- if ((r = mbrtowc(pwc, s, n, &state)) == (size_t) -2) {
-
- state.__wc = 0xffffU;
- return -1;
- }
- return r;
- }
- #endif
- #ifdef L_wctomb
- int wctomb(register char *__restrict s, wchar_t swc)
- {
- return (!s)
- ?
-
- is_stateful(ENCODING)
- : ((ssize_t) wcrtomb(s, swc, NULL));
- }
- #endif
- #ifdef L_mbstowcs
- size_t mbstowcs(wchar_t * __restrict pwcs, const char * __restrict s, size_t n)
- {
- mbstate_t state;
- const char *e = s;
- state.__mask = 0;
- return mbsrtowcs(pwcs, &e, n, &state);
- }
- #endif
- #ifdef L_wcstombs
- size_t wcstombs(char * __restrict s, const wchar_t * __restrict pwcs, size_t n)
- {
- const wchar_t *e = pwcs;
- return wcsrtombs(s, &e, n, NULL);
- }
- #endif
- #if defined(L_wcstol) || defined(L_wcstol_l)
- long __XL_NPP(wcstol)(const wchar_t * __restrict str,
- wchar_t ** __restrict endptr, int base __LOCALE_PARAM)
- {
- return __XL_NPP(_stdlib_wcsto_l)(str, endptr, base, 1 __LOCALE_ARG);
- }
- #if (ULONG_MAX == UINTMAX_MAX) && !defined(L_wcstol_l)
- strong_alias(wcstol,wcstoimax)
- #endif
- #if defined(ULLONG_MAX) && (ULLONG_MAX == ULONG_MAX)
- strong_alias_untyped(__XL_NPP(wcstol),__XL_NPP(wcstoll))
- #endif
- #endif
- #if defined(L_wcstoll) || defined(L_wcstoll_l)
- #if defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX)
- long long __XL_NPP(wcstoll)(const wchar_t * __restrict str,
- wchar_t ** __restrict endptr, int base
- __LOCALE_PARAM)
- {
- return (long long) __XL_NPP(_stdlib_wcsto_ll)(str, endptr, base, 1 __LOCALE_ARG);
- }
- #if !defined(L_wcstoll_l)
- #if (ULLONG_MAX == UINTMAX_MAX)
- strong_alias(wcstoll,wcstoimax)
- #endif
- strong_alias(wcstoll,wcstoq)
- #endif
- #endif
- #endif
- #if defined(L_wcstoul) || defined(L_wcstoul_l)
- unsigned long __XL_NPP(wcstoul)(const wchar_t * __restrict str,
- wchar_t ** __restrict endptr, int base
- __LOCALE_PARAM)
- {
- return __XL_NPP(_stdlib_wcsto_l)(str, endptr, base, 0 __LOCALE_ARG);
- }
- #if (ULONG_MAX == UINTMAX_MAX) && !defined(L_wcstoul_l)
- strong_alias(wcstoul,wcstoumax)
- #endif
- #if defined(ULLONG_MAX) && (ULLONG_MAX == ULONG_MAX)
- strong_alias_untyped(__XL_NPP(wcstoul),__XL_NPP(wcstoull))
- #endif
- #endif
- #if defined(L_wcstoull) || defined(L_wcstoull_l)
- #if defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX)
- unsigned long long __XL_NPP(wcstoull)(const wchar_t * __restrict str,
- wchar_t ** __restrict endptr, int base
- __LOCALE_PARAM)
- {
- return __XL_NPP(_stdlib_wcsto_ll)(str, endptr, base, 0 __LOCALE_ARG);
- }
- #if !defined(L_wcstoull_l)
- #if (ULLONG_MAX == UINTMAX_MAX)
- strong_alias(wcstoull,wcstoumax)
- #endif
- strong_alias(wcstoull,wcstouq)
- #endif
- #endif
- #endif
|