aboutsummaryrefslogtreecommitdiff
path: root/core/runtime
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-08-17 15:11:41 +0100
committergingerBill <bill@gingerbill.org>2018-08-17 15:11:41 +0100
commitb216e44870b1883cf3fb71994eb94f642fea43a1 (patch)
tree35deeadee9a5d2c5c0d7fe74d4d874385ce68897 /core/runtime
parent7d39b26cf4537943ecd668777d830dfa8579edbe (diff)
Add underlying type for `bit_set`
Diffstat (limited to 'core/runtime')
-rw-r--r--core/runtime/core.odin15
1 files changed, 12 insertions, 3 deletions
diff --git a/core/runtime/core.odin b/core/runtime/core.odin
index 59457bbe7..3700ace28 100644
--- a/core/runtime/core.odin
+++ b/core/runtime/core.odin
@@ -100,9 +100,10 @@ Type_Info_Bit_Field :: struct {
offsets: []i32,
};
Type_Info_Bit_Set :: struct {
- elem: ^Type_Info,
- lower: i64,
- upper: i64,
+ elem: ^Type_Info,
+ underlying: ^Type_Info, // Possibly nil
+ lower: i64,
+ upper: i64,
};
Type_Info :: struct {
@@ -427,6 +428,14 @@ reserve_dynamic_array :: proc(array: ^$T/[dynamic]$E, capacity: int, loc := #cal
return true;
}
+@(builtin)
+incl :: proc(s: ^$B/bit_set[$T], elem: T) {
+ s^ |= {elem};
+}
+@(builtin)
+excl :: proc(s: ^$B/bit_set[$T], elem: T) {
+ s^ &~= {elem};
+}