fix types of ansi_c/sysio to more closely match C ABI
also fixes some instances of using C library functions when there are nim alternatives available
This commit is contained in:
parent
796d939c6c
commit
64b0485207
15 changed files with 173 additions and 203 deletions
|
|
@ -329,13 +329,13 @@ proc dbgStackFrame(s: cstring, start: int, currFrame: PFrame) =
|
|||
|
||||
proc readLine(f: File, line: var StaticStr): bool =
|
||||
while true:
|
||||
var c = fgetc(f)
|
||||
var c = c_fgetc(f)
|
||||
if c < 0'i32:
|
||||
if line.len > 0: break
|
||||
else: return false
|
||||
if c == 10'i32: break # LF
|
||||
if c == 13'i32: # CR
|
||||
c = fgetc(f) # is the next char LF?
|
||||
c = c_fgetc(f) # is the next char LF?
|
||||
if c != 10'i32: ungetc(c, f) # no, put the character back
|
||||
break
|
||||
add line, chr(int(c))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue