summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/wchar.h8
-rw-r--r--lib/libc/stdio/getwc.c2
-rw-r--r--lib/libc/stdio/getwchar.c2
-rw-r--r--lib/libc/stdio/putwc.c2
-rw-r--r--lib/libc/stdio/putwchar.c2
5 files changed, 16 insertions, 0 deletions
diff --git a/include/wchar.h b/include/wchar.h
index b8bb90a..ea4bd12 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 e133868..ba5ab60 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 491ff9b..79dd7bc 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 e26102a..8fe065b 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 569ab92..5503071 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).
*/
OpenPOWER on IntegriCloud