blob: b023b5fb2cc19bc71a8cc51bfcb8108894977b18 [file] [log] [blame]
bigbiff bigbiffe60683a2013-02-22 20:55:50 -05001/* Declarations for wide characters */
2/* This file must be included last because the redefinition of wchar_t may
3 cause conflicts when system include files were included after it. */
4
5#ifdef HAVE_WIDECHAR
6
7# include <wchar.h>
8# include <wctype.h>
9
10#else /* !HAVE_WIDECHAR */
11
12# include <ctype.h>
13 /* Fallback for types */
14# define wchar_t char
15# define wint_t int
16# define WEOF EOF
17 /* Fallback for input operations */
18# define fgetwc fgetc
19# define getwc getc
20# define getwchar getchar
21# define fgetws fgets
22 /* Fallback for output operations */
23# define fputwc fputc
24# define putwc putc
25# define putwchar putchar
26# define fputws fputs
27 /* Fallback for character classification */
28# define iswgraph isgraph
29# define iswprint isprint
30# define iswspace isspace
31 /* Fallback for string functions */
32# define wcschr strchr
33# define wcsdup strdup
34# define wcslen strlen
35
36# define wcwidth(c) 1
37
38#endif /* HAVE_WIDECHAR */