fix stdout(etc) for emscripten
This commit is contained in:
parent
9657a83698
commit
2e20f5648b
2 changed files with 8 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue