diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2026-01-29 10:48:05 +0000 |
|---|---|---|
| committer | gingerBill <gingerBill@users.noreply.github.com> | 2026-01-29 10:49:26 +0000 |
| commit | 07d814d9cf3bf2065e4122dba91817935dca7c60 (patch) | |
| tree | e19ee510f617a487d8e6391b59bfaf121efd8e36 /base | |
| parent | 4a7fb4666722b3ff45998c3bc11f03150a2fe53f (diff) | |
Add `struct #simple` to force a struct to use simple comparison if all of the fields "nearly simply comparable".
Diffstat (limited to 'base')
| -rw-r--r-- | base/runtime/core.odin | 1 | ||||
| -rw-r--r-- | base/runtime/print.odin | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/base/runtime/core.odin b/base/runtime/core.odin index 58a0b8ad1..5a0b3766c 100644 --- a/base/runtime/core.odin +++ b/base/runtime/core.odin @@ -122,6 +122,7 @@ Type_Info_Struct_Flag :: enum u8 { raw_union = 1, all_or_none = 2, align = 3, + simple = 4, } Type_Info_Struct :: struct { diff --git a/base/runtime/print.odin b/base/runtime/print.odin index 2deb0f4b1..2cdde8152 100644 --- a/base/runtime/print.odin +++ b/base/runtime/print.odin @@ -421,6 +421,7 @@ print_type :: #force_no_inline proc "contextless" (ti: ^Type_Info) { if .packed in info.flags { print_string("#packed ") } if .raw_union in info.flags { print_string("#raw_union ") } if .all_or_none in info.flags { print_string("#all_or_none ") } + if .simple in info.flags { print_string("#simple ") } if .align in info.flags { print_string("#align(") print_u64(u64(ti.align)) @@ -835,6 +836,7 @@ write_write_type :: #force_no_inline proc "contextless" (i: ^int, buf: []byte, t if .packed in info.flags { write_string(i, buf, "#packed ") or_return } if .raw_union in info.flags { write_string(i, buf, "#raw_union ") or_return } if .all_or_none in info.flags { write_string(i, buf, "#all_or_none ") or_return } + if .simple in info.flags { write_string(i, buf, "#simple ") or_return } if .align in info.flags { write_string(i, buf, "#align(") or_return write_u64(i, buf, u64(ti.align)) or_return |