fixes --os:standalone
This commit is contained in:
parent
1a5e30b053
commit
30f8568570
3 changed files with 14 additions and 9 deletions
|
|
@ -1889,9 +1889,11 @@ when not defined(JS): #and not defined(NimrodVM):
|
||||||
|
|
||||||
# text file handling:
|
# text file handling:
|
||||||
var
|
var
|
||||||
stdin* {.importc: "stdin", noDecl.}: TFile ## The standard input stream.
|
stdin* {.importc: "stdin", header: "<stdio.h>".}: TFile
|
||||||
stdout* {.importc: "stdout", noDecl.}: TFile ## The standard output stream.
|
## The standard input stream.
|
||||||
stderr* {.importc: "stderr", noDecl.}: TFile
|
stdout* {.importc: "stdout", header: "<stdio.h>".}: TFile
|
||||||
|
## The standard output stream.
|
||||||
|
stderr* {.importc: "stderr", header: "<stdio.h>".}: TFile
|
||||||
## The standard error stream.
|
## The standard error stream.
|
||||||
##
|
##
|
||||||
## Note: In my opinion, this should not be used -- the concept of a
|
## Note: In my opinion, this should not be used -- the concept of a
|
||||||
|
|
|
||||||
|
|
@ -34,9 +34,9 @@ type
|
||||||
C_JmpBuf {.importc: "jmp_buf", header: "<setjmp.h>".} = array[0..31, int]
|
C_JmpBuf {.importc: "jmp_buf", header: "<setjmp.h>".} = array[0..31, int]
|
||||||
|
|
||||||
var
|
var
|
||||||
c_stdin {.importc: "stdin", header: "<stdio.h>".}: C_TextFileStar
|
c_stdin {.importc: "stdin", nodecl.}: C_TextFileStar
|
||||||
c_stdout {.importc: "stdout", header: "<stdio.h>".}: C_TextFileStar
|
c_stdout {.importc: "stdout", nodecl.}: C_TextFileStar
|
||||||
c_stderr {.importc: "stderr", header: "<stdio.h>".}: C_TextFileStar
|
c_stderr {.importc: "stderr", nodecl.}: C_TextFileStar
|
||||||
|
|
||||||
# constants faked as variables:
|
# constants faked as variables:
|
||||||
when not defined(SIGINT):
|
when not defined(SIGINT):
|
||||||
|
|
@ -109,7 +109,8 @@ proc c_free(p: pointer) {.importc: "free", header: "<stdlib.h>".}
|
||||||
proc c_realloc(p: pointer, newsize: int): pointer {.
|
proc c_realloc(p: pointer, newsize: int): pointer {.
|
||||||
importc: "realloc", header: "<stdlib.h>".}
|
importc: "realloc", header: "<stdlib.h>".}
|
||||||
|
|
||||||
when not defined(errno):
|
when hostOS != "standalone":
|
||||||
|
when not defined(errno):
|
||||||
var errno {.importc, header: "<errno.h>".}: cint ## error variable
|
var errno {.importc, header: "<errno.h>".}: cint ## error variable
|
||||||
proc strerror(errnum: cint): cstring {.importc, header: "<string.h>".}
|
proc strerror(errnum: cint): cstring {.importc, header: "<string.h>".}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
|
|
||||||
proc printf(frmt: cstring) {.varargs, header: "<stdio.h>", cdecl.}
|
proc printf(frmt: cstring) {.varargs, header: "<stdio.h>", cdecl.}
|
||||||
|
|
||||||
printf("hi %ld\n", 4777)
|
var x = 0
|
||||||
|
inc x
|
||||||
|
printf("hi %ld\n", x+4777)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue