implement part of core foundation framework bindings for err message
This commit is contained in:
1 parent
32a4a5e601
commit
0d413b8136
4 files changed
+106
-1
No files matched your search
@@ -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