Use union #shared_nil for os.Error

This commit is contained in:
gingerBill
2024-08-04 11:05:30 +01:00
parent e60951a902
commit 9f9abb8fb3
18 changed files with 93 additions and 87 deletions
+2 -2
View File
@@ -8,8 +8,8 @@ HAS_RAND_BYTES :: true
@(private)
_rand_bytes :: proc(dst: []byte) {
ret := (os.Errno)(win32.BCryptGenRandom(nil, raw_data(dst), u32(len(dst)), win32.BCRYPT_USE_SYSTEM_PREFERRED_RNG))
if ret != os.ERROR_NONE {
ret := os.Platform_Error(win32.BCryptGenRandom(nil, raw_data(dst), u32(len(dst)), win32.BCRYPT_USE_SYSTEM_PREFERRED_RNG))
if ret != nil {
#partial switch ret {
case os.ERROR_INVALID_HANDLE:
// The handle to the first parameter is invalid.