diff --git a/include/wchar.h b/include/wchar.h index b8bb90a14a4b..ea4bd12e3362 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -171,6 +171,14 @@ wchar_t *wmemset(wchar_t *, wchar_t, size_t); int wprintf(const wchar_t * __restrict, ...); int wscanf(const wchar_t * __restrict, ...); +extern struct __sFILE *__stdinp; +extern struct __sFILE *__stdoutp; + +#define getwc(fp) getwc(fp) +#define getwchar() fgetwc(__stdinp) +#define putwc(wc, fp) fputwc(wc, fp) +#define putwchar(wc) fputwc(wc, __stdoutp) + #if __ISO_C_VISIBLE >= 1999 int vfwscanf(struct __sFILE * __restrict, const wchar_t * __restrict, __va_list); diff --git a/lib/libc/stdio/getwc.c b/lib/libc/stdio/getwc.c index e133868f0b9f..ba5ab6011bfd 100644 --- a/lib/libc/stdio/getwc.c +++ b/lib/libc/stdio/getwc.c @@ -34,6 +34,8 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" #include "local.h" +#undef getwc + /* * Synonym for fgetwc(). The only difference is that getwc(), if it is a * macro, may evaluate `fp' more than once. diff --git a/lib/libc/stdio/getwchar.c b/lib/libc/stdio/getwchar.c index 491ff9b7ffec..79dd7bc4b33b 100644 --- a/lib/libc/stdio/getwchar.c +++ b/lib/libc/stdio/getwchar.c @@ -34,6 +34,8 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" #include "local.h" +#undef getwchar + /* * Synonym for fgetwc(stdin). */ diff --git a/lib/libc/stdio/putwc.c b/lib/libc/stdio/putwc.c index e26102a663f2..8fe065bdfe32 100644 --- a/lib/libc/stdio/putwc.c +++ b/lib/libc/stdio/putwc.c @@ -34,6 +34,8 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" #include "local.h" +#undef putwc + /* * Synonym for fputwc(). The only difference is that putwc(), if it is a * macro, may evaluate `fp' more than once. diff --git a/lib/libc/stdio/putwchar.c b/lib/libc/stdio/putwchar.c index 569ab92820b8..55030713c752 100644 --- a/lib/libc/stdio/putwchar.c +++ b/lib/libc/stdio/putwchar.c @@ -34,6 +34,8 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" #include "local.h" +#undef putwchar + /* * Synonym for fputwc(wc, stdout). */