mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-21 14:55:24 +00:00
fix int32's that should be uint32 on BSD & OSX (#24078)
fixes #24076
As described in #24076, misannotating these types causes codegen errors.
Sources for the types are https://github.com/openbsd/src/blob/master/sys
for BSD and https://opensource.apple.com/source/Libinfo/Libinfo-391/ and
[_types.h](https://opensource.apple.com/source/xnu/xnu-1456.1.26/bsd/sys/_types.h.auto.html)
for OSX.
(cherry picked from commit 7de4ace949)
This commit is contained in:
8
tests/stdlib/twronguidtype.nim
Normal file
8
tests/stdlib/twronguidtype.nim
Normal file
@@ -0,0 +1,8 @@
|
||||
# issue #24076
|
||||
|
||||
when defined(macosx) or defined(freebsd) or defined(openbsd) or defined(netbsd):
|
||||
import std/posix
|
||||
proc uid(x: uint32): Uid = Uid(x)
|
||||
var y: uint32
|
||||
let myUid = geteuid()
|
||||
discard myUid == uid(y)
|
||||
Reference in New Issue
Block a user