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
|
|
@ -104,12 +104,7 @@ proc newWideCString*(source: cstring, L: int): WideCString =
|
|||
proc newWideCString*(s: cstring): WideCString =
|
||||
if s.isNil: return nil
|
||||
|
||||
when not declared(c_strlen):
|
||||
proc c_strlen(a: cstring): int {.
|
||||
header: "<string.h>", noSideEffect, importc: "strlen".}
|
||||
|
||||
let L = c_strlen(s)
|
||||
result = newWideCString(s, L)
|
||||
result = newWideCString(s, s.len)
|
||||
|
||||
proc newWideCString*(s: string): WideCString =
|
||||
result = newWideCString(s, s.len)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue