aboutsummaryrefslogtreecommitdiff
path: root/base/runtime/core.odin
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-06-15 15:08:49 +0100
committergingerBill <bill@gingerbill.org>2024-06-15 15:08:49 +0100
commiteaec8a2bbf26c80f20aee10798236a4eb21dcf24 (patch)
treee42ff845202f1ce9fd52fd9f68027f60c40fc279 /base/runtime/core.odin
parentc2a01096c4c83516c1bf966aa52f06f8d53a9d47 (diff)
Add `runtime.default_random_generator`
Diffstat (limited to 'base/runtime/core.odin')
-rw-r--r--base/runtime/core.odin7
1 files changed, 6 insertions, 1 deletions
diff --git a/base/runtime/core.odin b/base/runtime/core.odin
index 9669e86aa..a4a433d94 100644
--- a/base/runtime/core.odin
+++ b/base/runtime/core.odin
@@ -410,8 +410,10 @@ Random_Generator_Query_Info_Flag :: enum u32 {
}
Random_Generator_Query_Info :: distinct bit_set[Random_Generator_Query_Info_Flag; u32]
+Random_Generator_Proc :: #type proc(data: rawptr, mode: Random_Generator_Mode, p: []byte)
+
Random_Generator :: struct {
- procedure: proc(data: rawptr, mode: Random_Generator_Mode, p: []byte),
+ procedure: Random_Generator_Proc,
data: rawptr,
}
@@ -727,6 +729,9 @@ __init_context :: proc "contextless" (c: ^Context) {
c.logger.procedure = default_logger_proc
c.logger.data = nil
+
+ c.random_generator.procedure = default_random_generator_proc
+ c.random_generator.data = nil
}
default_assertion_failure_proc :: proc(prefix, message: string, loc: Source_Code_Location) -> ! {