standalone target works again
This commit is contained in:
parent
f9f5bd6dd8
commit
8a3fd4b129
1 changed files with 20 additions and 21 deletions
|
|
@ -2591,28 +2591,27 @@ when not defined(JS): #and not defined(nimscript):
|
||||||
|
|
||||||
|
|
||||||
# ----------------- IO Part ------------------------------------------------
|
# ----------------- IO Part ------------------------------------------------
|
||||||
when hostOS != "standalone":
|
type
|
||||||
type
|
CFile {.importc: "FILE", header: "<stdio.h>",
|
||||||
CFile {.importc: "FILE", header: "<stdio.h>",
|
final, incompletestruct.} = object
|
||||||
final, incompletestruct.} = object
|
File* = ptr CFile ## The type representing a file handle.
|
||||||
File* = ptr CFile ## The type representing a file handle.
|
|
||||||
|
|
||||||
FileMode* = enum ## The file mode when opening a file.
|
FileMode* = enum ## The file mode when opening a file.
|
||||||
fmRead, ## Open the file for read access only.
|
fmRead, ## Open the file for read access only.
|
||||||
fmWrite, ## Open the file for write access only.
|
fmWrite, ## Open the file for write access only.
|
||||||
fmReadWrite, ## Open the file for read and write access.
|
fmReadWrite, ## Open the file for read and write access.
|
||||||
## If the file does not exist, it will be
|
## If the file does not exist, it will be
|
||||||
## created.
|
## created.
|
||||||
fmReadWriteExisting, ## Open the file for read and write access.
|
fmReadWriteExisting, ## Open the file for read and write access.
|
||||||
## If the file does not exist, it will not be
|
## If the file does not exist, it will not be
|
||||||
## created.
|
## created.
|
||||||
fmAppend ## Open the file for writing only; append data
|
fmAppend ## Open the file for writing only; append data
|
||||||
## at the end.
|
## at the end.
|
||||||
|
|
||||||
FileHandle* = cint ## type that represents an OS file handle; this is
|
FileHandle* = cint ## type that represents an OS file handle; this is
|
||||||
## useful for low-level file access
|
## useful for low-level file access
|
||||||
|
|
||||||
{.deprecated: [TFile: File, TFileHandle: FileHandle, TFileMode: FileMode].}
|
{.deprecated: [TFile: File, TFileHandle: FileHandle, TFileMode: FileMode].}
|
||||||
|
|
||||||
when not defined(nimscript):
|
when not defined(nimscript):
|
||||||
include "system/ansi_c"
|
include "system/ansi_c"
|
||||||
|
|
@ -2625,7 +2624,7 @@ when not defined(JS): #and not defined(nimscript):
|
||||||
elif x > y: result = 1
|
elif x > y: result = 1
|
||||||
else: result = 0
|
else: result = 0
|
||||||
|
|
||||||
when not defined(nimscript):
|
when not defined(nimscript) and hostOS != "standalone":
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
# work-around C's sucking abstraction:
|
# work-around C's sucking abstraction:
|
||||||
# BUGFIX: stdin and stdout should be binary files!
|
# BUGFIX: stdin and stdout should be binary files!
|
||||||
|
|
@ -2946,7 +2945,7 @@ when not defined(JS): #and not defined(nimscript):
|
||||||
else:
|
else:
|
||||||
include "system/sysio"
|
include "system/sysio"
|
||||||
|
|
||||||
when not defined(nimscript):
|
when not defined(nimscript) and hostOS != "standalone":
|
||||||
iterator lines*(filename: string): TaintedString {.tags: [ReadIOEffect].} =
|
iterator lines*(filename: string): TaintedString {.tags: [ReadIOEffect].} =
|
||||||
## Iterates over any line in the file named `filename`.
|
## Iterates over any line in the file named `filename`.
|
||||||
##
|
##
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue