diff options
Diffstat (limited to 'lib/system/ansi_c.nim')
-rw-r--r-- | lib/system/ansi_c.nim | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/system/ansi_c.nim b/lib/system/ansi_c.nim index 6649e9517..cb2303b61 100644 --- a/lib/system/ansi_c.nim +++ b/lib/system/ansi_c.nim @@ -117,9 +117,10 @@ type CFilePtr* = ptr CFile ## The type representing a file handle. # 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 cstderr* {.importc: stderrName, header: "<stdio.h>".}: CFilePtr |