aboutsummaryrefslogtreecommitdiff
path: root/libio/stdfiles.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/stdfiles.c')
-rw-r--r--libio/stdfiles.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/libio/stdfiles.c b/libio/stdfiles.c
index 866746d437..b81fef8b88 100644
--- a/libio/stdfiles.c
+++ b/libio/stdfiles.c
@@ -33,20 +33,35 @@
#include "libioP.h"
#ifdef _IO_MTSAFE_IO
-#define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
+# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+# define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_initializer; \
static struct _IO_wide_data _IO_wide_data_##FD \
= { ._wide_vtable = &_IO_wfile_jumps }; \
struct _IO_FILE_plus NAME \
= {FILEBUF_LITERAL(CHAIN, FLAGS, FD, &_IO_wide_data_##FD), \
&_IO_file_jumps};
+# else
+# define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
+ static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_initializer; \
+ struct _IO_FILE_plus NAME \
+ = {FILEBUF_LITERAL(CHAIN, FLAGS, FD, NULL), \
+ &_IO_file_jumps};
+# endif
#else
-#define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
+# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+# define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
static struct _IO_wide_data _IO_wide_data_##FD \
= { ._wide_vtable = &_IO_wfile_jumps }; \
struct _IO_FILE_plus NAME \
= {FILEBUF_LITERAL(CHAIN, FLAGS, FD, &_IO_wide_data_##FD), \
&_IO_file_jumps};
+# else
+# define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
+ struct _IO_FILE_plus NAME \
+ = {FILEBUF_LITERAL(CHAIN, FLAGS, FD, NULL), \
+ &_IO_file_jumps};
+# endif
#endif
DEF_STDFILE(_IO_2_1_stdin_, 0, 0, _IO_NO_WRITES);