diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 13:14:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 13:14:44 +0000 |
commit | 30ff6afe596eddafacf22b1a5b2d1a3d6254ea15 (patch) | |
tree | 9b788335f92174baf7ee18f03ca8330b8c19ce2b /include/widechar.h | |
parent | Initial commit. (diff) | |
download | util-linux-30ff6afe596eddafacf22b1a5b2d1a3d6254ea15.tar.xz util-linux-30ff6afe596eddafacf22b1a5b2d1a3d6254ea15.zip |
Adding upstream version 2.36.1.upstream/2.36.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'include/widechar.h')
-rw-r--r-- | include/widechar.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/include/widechar.h b/include/widechar.h new file mode 100644 index 0000000..c1f2cf2 --- /dev/null +++ b/include/widechar.h @@ -0,0 +1,47 @@ +/* Declarations for wide characters */ +/* This file must be included last because the redefinition of wchar_t may + cause conflicts when system include files were included after it. */ + +#ifdef HAVE_WIDECHAR + +# include <wchar.h> +# include <wctype.h> + +#else /* !HAVE_WIDECHAR */ + +# include <ctype.h> + /* Fallback for types */ +# define wchar_t char +# define wint_t int +# ifndef WEOF +# define WEOF EOF +# endif + + /* Fallback for input operations */ +# define fgetwc fgetc +# define getwc getc +# define getwchar getchar +# define fgetws fgets + + /* Fallback for output operations */ +# define fputwc fputc +# define putwc putc +# define putwchar putchar +# define fputws fputs + + /* Fallback for character classification */ +# define iswgraph isgraph +# define iswprint isprint +# define iswspace isspace + + /* Fallback for string functions */ +# define wcschr strchr +# define wcsdup strdup +# define wcslen strlen +# define wcspbrk strpbrk + +# define wcwidth(c) (1) +# define wmemset memset +# define ungetwc ungetc + +#endif /* HAVE_WIDECHAR */ |