mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 14:48:47 +00:00
implement part of core foundation framework bindings for err message
This commit is contained in:
@@ -6,6 +6,7 @@ import "core:sys/darwin"
|
||||
_rand_bytes :: proc(dst: []byte) {
|
||||
res := darwin.SecRandomCopyBytes(count=len(dst), bytes=raw_data(dst))
|
||||
if res != .Success {
|
||||
panic(fmt.tprintf("crypto/rand_bytes: SecRandomCopyBytes returned non-zero result: %v", res))
|
||||
msg := darwin.CFStringCopyToOdinString(darwin.SecCopyErrorMessageString(res))
|
||||
panic(fmt.tprintf("crypto/rand_bytes: SecRandomCopyBytes returned non-zero result: %v %s", res, msg))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user