diff options
| -rw-r--r-- | src/wchar/fgetwc.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/wchar/fgetwc.c b/src/wchar/fgetwc.c index 8d725b6e..04cc2781 100644 --- a/src/wchar/fgetwc.c +++ b/src/wchar/fgetwc.c @@ -1,27 +1,22 @@ #include <wchar.h> -#include "stdio.h" -#include "../stdio/_stdio.h" -#include "limits.h" - -#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 199506L -#include "../unistd/read.c" -#endif +#include <stdio.h> +#include <limits.h> +#include "stdio/_stdio.h" wint_t fgetwc(FILE * stream) { - if (fwide(stream, 1) <= 0) { + char mbr[MB_LEN_MAX+1] = {0}; + mbstate_t ps = 0; + wint_t wc = 0; + int n = 0; + if (fwide(stream, 1) <= 0) { return WEOF; } flockfile(stream); stream->orientation = -1; - char mbr[MB_LEN_MAX+1] = {0}; - int n = 0; - mbstate_t ps = 0; - wint_t wc = 0; - /* FIXME: check for (size_t)-2 and (size_t)-1 from mbrtowc */ do { mbr[n++] = getc_unlocked(stream); |
