aboutsummaryrefslogtreecommitdiff
path: root/system/include/libc
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-03-28 15:00:58 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-03-28 15:00:58 -0700
commit054b2403e959ef760f48a8a501477b675bd90221 (patch)
tree1bf244662855f96f04a44e793aa54d11150f6b39 /system/include/libc
parent85452a0b99426b5caa9cec5aa94730e850776981 (diff)
do not use impure stuff for stdin etc, it makes comparing to native builds harder
Diffstat (limited to 'system/include/libc')
-rw-r--r--system/include/libc/stdio.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/system/include/libc/stdio.h b/system/include/libc/stdio.h
index 19e460a3..4e14df79 100644
--- a/system/include/libc/stdio.h
+++ b/system/include/libc/stdio.h
@@ -142,6 +142,7 @@ typedef _fpos64_t fpos64_t;
#define TMP_MAX 26
+#if 0 /* XXX Emscripten: do not use impure stuff for std*, it makes comparing to native builds harder */
#ifndef _REENT_ONLY
#define stdin (_REENT->_stdin)
#define stdout (_REENT->_stdout)
@@ -151,6 +152,14 @@ typedef _fpos64_t fpos64_t;
#define stdout (_impure_ptr->_stdout)
#define stderr (_impure_ptr->_stderr)
#endif /* _REENT_ONLY */
+#else
+extern FILE *stdin;
+extern FILE *stdout;
+extern FILE *stderr;
+#define stdin stdin
+#define stdout stdout
+#define stderr stderr
+#endif
#define _stdin_r(x) ((x)->_stdin)
#define _stdout_r(x) ((x)->_stdout)