mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 03:32:32 +00:00
fix stdout(etc) for emscripten
This commit is contained in:
committed by
Dominik Picheta
parent
9657a83698
commit
2e20f5648b
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user