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.
|
CFilePtr* = ptr CFile ## The type representing a file handle.
|
||||||
|
|
||||||
# duplicated between io and ansi_c
|
# duplicated between io and ansi_c
|
||||||
const stderrName = when defined(osx): "__stderrp" else: "stderr"
|
const stdioUsesMacros = defined(osx) and not defined(emscripten)
|
||||||
const stdoutName = when defined(osx): "__stdoutp" else: "stdout"
|
const stderrName = when stdioUsesMacros: "__stderrp" else: "stderr"
|
||||||
const stdinName = when defined(osx): "__stdinp" else: "stdin"
|
const stdoutName = when stdioUsesMacros: "__stdoutp" else: "stdout"
|
||||||
|
const stdinName = when stdioUsesMacros: "__stdinp" else: "stdin"
|
||||||
|
|
||||||
var
|
var
|
||||||
cstderr* {.importc: stderrName, header: "<stdio.h>".}: CFilePtr
|
cstderr* {.importc: stderrName, header: "<stdio.h>".}: CFilePtr
|
||||||
|
|
|
||||||
|
|
@ -36,9 +36,10 @@ type
|
||||||
# text file handling:
|
# text file handling:
|
||||||
when not defined(nimscript) and not defined(js):
|
when not defined(nimscript) and not defined(js):
|
||||||
# duplicated between io and ansi_c
|
# duplicated between io and ansi_c
|
||||||
const stderrName = when defined(osx): "__stderrp" else: "stderr"
|
const stdioUsesMacros = defined(osx) and not defined(emscripten)
|
||||||
const stdoutName = when defined(osx): "__stdoutp" else: "stdout"
|
const stderrName = when stdioUsesMacros: "__stderrp" else: "stderr"
|
||||||
const stdinName = when defined(osx): "__stdinp" else: "stdin"
|
const stdoutName = when stdioUsesMacros: "__stdoutp" else: "stdout"
|
||||||
|
const stdinName = when stdioUsesMacros: "__stdinp" else: "stdin"
|
||||||
|
|
||||||
var
|
var
|
||||||
stdin* {.importc: stdinName, header: "<stdio.h>".}: File
|
stdin* {.importc: stdinName, header: "<stdio.h>".}: File
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue