Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / device / include / wchar.h
bloba5379dc78d578994b657e5246eed73caef91f084
1 /*-------------------------------------------------------------------------
2 wchar.h - Extended and multibyte wide character utilitites (ISO C 11 7.29)
4 Copyright (c) 2015-2016, Philipp Klaus Krause / pkk@spth.de
5 2023, Benedikt Freisen / b.freisen@gmx.net
7 This library is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 2, or (at your option) any
10 later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this library; see the file COPYING. If not, write to the
19 Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
20 MA 02110-1301, USA.
22 As a special exception, if you link this library with other files,
23 some of which are compiled with SDCC, to produce an executable,
24 this library does not by itself cause the resulting executable to
25 be covered by the GNU General Public License. This exception does
26 not however invalidate any other reasons why the executable file
27 might be covered by the GNU General Public License.
28 -------------------------------------------------------------------------*/
30 #ifndef __SDCC_WCHAR_H
31 #define __SDCC_WCHAR_H 1
33 #ifndef __WCHAR_T_DEFINED
34 #define __WCHAR_T_DEFINED
35 typedef unsigned long int wchar_t;
36 #endif
38 #ifndef __SIZE_T_DEFINED
39 #define __SIZE_T_DEFINED
40 typedef unsigned int size_t;
41 #endif
43 #ifndef __MBSTATE_T_DEFINED
44 #define __MBSTATE_T_DEFINED
45 typedef struct {unsigned char c[3];} mbstate_t;
46 #endif
48 #ifndef __WINT_T_DEFINED
49 #define __WINT_T_DEFINED
50 typedef unsigned long int wint_t;
51 #endif
53 struct tm;
55 #ifndef WEOF
56 #define WEOF 0xfffffffful
57 #endif
59 /* C99 Character classification */
61 inline int iswblank(wint_t c)
63 return ((wchar_t)c == L' ' || (wchar_t)c == L'\t');
66 /* C99 Wide string comparison functions (ISO C11 7.29.4.4) */
67 int wcscmp(const wchar_t *s1, const wchar_t *s2);
68 int wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t count);
70 /* C99 Miscellaneous functions (ISO C11 7.29.4.6) */
71 size_t wcslen(const wchar_t *s);
73 /* C2Y length function: */
74 size_t wcsnlen (const wchar_t *s, size_t n);
76 /* C99 Single-byte/wide character conversion functions (ISO C 11 7.29.6.1) */
77 wint_t btowc(int c);
78 int wctob(wint_t c);
80 /* C99 Conversion state functions (ISO C 11 7.29.6.2) */
81 int mbsinit(const mbstate_t *ps);
83 /* C99 Restartable multibyte/wide character conversion functions (ISO C 11 7.29.6.3) */
84 size_t mbrlen(const char *restrict s, size_t n, mbstate_t *restrict ps);
85 size_t mbrtowc(wchar_t *restrict pwc, const char *restrict s, size_t n, mbstate_t *restrict ps);
86 size_t wcrtomb(char *restrict s, wchar_t wc, mbstate_t *restrict ps);
88 /* C99 Wide string numeric conversion functions (ISO C 11 7.29.4.1) */
89 long int wcstol(const wchar_t *restrict nptr, wchar_t **restrict endptr, int base);
90 unsigned long int wcstoul(const wchar_t *restrict nptr, wchar_t **restrict endptr, int base);
91 #ifdef __SDCC_LONGLONG
92 long long int wcstoll(const wchar_t *restrict nptr, wchar_t **restrict endptr, int base);
93 unsigned long long int wcstoull(const wchar_t *restrict nptr, wchar_t **restrict endptr, int base);
94 #endif
96 #endif /* __SDCC_WCHAR_H */