summary refs log tree commit diff stats
path: root/lib/system/io.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/system/io.nim')
-rw-r--r--lib/system/io.nim7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/system/io.nim b/lib/system/io.nim
index 41716f9af..8e3acd0b9 100644
--- a/lib/system/io.nim
+++ b/lib/system/io.nim
@@ -36,9 +36,10 @@ type
 # text file handling:
 when not defined(nimscript) and not defined(js):
   # duplicated between io and ansi_c
-  const stderrName = when defined(osx): "__stderrp" else: "stderr"
-  const stdoutName = when defined(osx): "__stdoutp" else: "stdout"
-  const stdinName = when defined(osx): "__stdinp" else: "stdin"
+  const stdioUsesMacros = defined(osx) and not defined(emscripten)
+  const stderrName = when stdioUsesMacros: "__stderrp" else: "stderr"
+  const stdoutName = when stdioUsesMacros: "__stdoutp" else: "stdout"
+  const stdinName = when stdioUsesMacros: "__stdinp" else: "stdin"
 
   var
     stdin* {.importc: stdinName, header: "<stdio.h>".}: File