tyInt tyUint fit target int bit width (#20829)
This commit is contained in:
parent
a70d3abd37
commit
658b28dc57
17 changed files with 306 additions and 267 deletions
|
|
@ -2001,7 +2001,7 @@ when notJSnotNims:
|
|||
proc equalMem(a, b: pointer, size: Natural): bool =
|
||||
nimCmpMem(a, b, size) == 0
|
||||
proc cmpMem(a, b: pointer, size: Natural): int =
|
||||
nimCmpMem(a, b, size)
|
||||
nimCmpMem(a, b, size).int
|
||||
|
||||
when not defined(js):
|
||||
proc cmp(x, y: string): int =
|
||||
|
|
@ -2300,11 +2300,13 @@ else:
|
|||
type ExitCodeRange = int8
|
||||
else: # win32 uses low 32 bits
|
||||
type ExitCodeRange = cint
|
||||
|
||||
if errorcode < low(ExitCodeRange):
|
||||
rawQuit(low(ExitCodeRange).cint)
|
||||
elif errorcode > high(ExitCodeRange):
|
||||
rawQuit(high(ExitCodeRange).cint)
|
||||
when sizeof(errorcode) > sizeof(ExitCodeRange):
|
||||
if errorcode < low(ExitCodeRange):
|
||||
rawQuit(low(ExitCodeRange).cint)
|
||||
elif errorcode > high(ExitCodeRange):
|
||||
rawQuit(high(ExitCodeRange).cint)
|
||||
else:
|
||||
rawQuit(errorcode.cint)
|
||||
else:
|
||||
rawQuit(errorcode.cint)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue