]> git.ipfire.org Git - thirdparty/util-linux.git/blob - include/widechar.h
Merge branch 'ci/meson-werror' of https://github.com/t-8ch/util-linux
[thirdparty/util-linux.git] / include / widechar.h
1 /*
2 * No copyright is claimed. This code is in the public domain; do with
3 * it what you wish.
4 */
5
6 /* Declarations for wide characters */
7 /* This file must be included last because the redefinition of wchar_t may
8 cause conflicts when system include files were included after it. */
9
10 #ifdef HAVE_WIDECHAR
11
12 # include <wchar.h>
13 # include <wctype.h>
14
15 #else /* !HAVE_WIDECHAR */
16
17 # include <ctype.h>
18 /* Fallback for types */
19 # define wchar_t char
20 # define wint_t int
21 # ifndef WEOF
22 # define WEOF EOF
23 # endif
24
25 /* Fallback for input operations */
26 # define fgetwc fgetc
27 # define getwc getc
28 # define getwchar getchar
29 # define fgetws fgets
30
31 /* Fallback for output operations */
32 # define fputwc fputc
33 # define putwc putc
34 # define putwchar putchar
35 # define fputws fputs
36
37 /* Fallback for character classification */
38 # define iswgraph isgraph
39 # define iswprint isprint
40 # define iswspace isspace
41
42 /* Fallback for string functions */
43 # define wcschr strchr
44 # define wcsdup strdup
45 # define wcslen strlen
46 # define wcspbrk strpbrk
47
48 # define wcwidth(c) (1)
49 # define wmemset memset
50 # define ungetwc ungetc
51
52 #endif /* HAVE_WIDECHAR */