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
|
|
@ -61,7 +61,7 @@ proc osErrorMsg*(): string {.rtl, extern: "nos$1", deprecated.} =
|
|||
result = $msgbuf
|
||||
if msgbuf != nil: localFree(msgbuf)
|
||||
if errno != 0'i32:
|
||||
result = $os.strerror(errno)
|
||||
result = $os.c_strerror(errno)
|
||||
|
||||
{.push warning[deprecated]: off.}
|
||||
proc raiseOSError*(msg: string = "") {.noinline, rtl, extern: "nos$1",
|
||||
|
|
@ -114,7 +114,7 @@ proc osErrorMsg*(errorCode: OSErrorCode): string =
|
|||
if msgbuf != nil: localFree(msgbuf)
|
||||
else:
|
||||
if errorCode != OSErrorCode(0'i32):
|
||||
result = $os.strerror(errorCode.int32)
|
||||
result = $os.c_strerror(errorCode.int32)
|
||||
|
||||
proc raiseOSError*(errorCode: OSErrorCode; additionalInfo = "") {.noinline.} =
|
||||
## Raises an ``OSError`` exception. The ``errorCode`` will determine the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue