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:
metagn
2024-09-09 10:46:47 +03:00
committed by narimiran
parent d51236e9cc
commit 56e7c75e03
3 changed files with 18 additions and 10 deletions

View 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)