128 Commits

Author SHA1 Message Date
gingerBill
cb2f3aca8b Change seed logic 2025-12-21 17:13:59 +00:00
gingerBill
998da2c2da Add reflect.default_map_hash_by_ptr 2025-12-21 17:09:22 +00:00
gingerBill
4e06134618 Add reflect.has_no_indirections 2025-12-01 12:34:22 +00:00
blob1807
062f445ee3 Fix is_pointer_internally not handling Named Types. 2025-11-28 13:02:49 +10:00
gingerBill
593d2e6daa Add #all_or_none 2025-11-05 13:30:40 +00:00
Jeroen van Rijn
7a9ea3ee6d Further overhaul of package line comments. 2025-10-09 23:05:29 +02:00
Jeroen van Rijn
2bc409eab5 More package lines. 2025-10-09 20:40:13 +02:00
Jeroen van Rijn
5320feb673 Add reflect.as_string16 and fix typos 2025-10-07 22:54:35 +02:00
gingerBill
1400952530 Merge examples 2025-10-07 12:07:40 +01:00
gingerBill
d14576e843 Space to tabs 2025-10-07 12:00:59 +01:00
gingerBill
56f275bc71 Fix typo 2025-10-07 11:52:49 +01:00
gingerBill
1a90b06fac Improve documentation for core:reflect 2025-10-07 11:49:56 +01:00
gingerBill
af3184adc9 Change is_utf16 field to encoding and use an enum 2025-08-05 15:12:54 +01:00
gingerBill
ae02d3d02d Begin supporting string16 across the core library 2025-08-02 11:55:16 +01:00
gingerBill
9b8223dd69 Remove use of .no_copy 2025-07-30 23:19:14 +01:00
gingerBill
3dcc22fa6d Change hashing rules for float-like types to make 0 == -0 2025-04-16 10:52:35 +01:00
Jeroen van Rijn
bb38775fb1 Remove Type_Info_Tuple 2025-04-13 21:51:57 +02:00
Jeroen van Rijn
41d4ddbc5e Add reflect.length + reflect.capacity support for #simd[N]T 2025-04-11 22:44:02 +02:00
Jeroen van Rijn
f4ce84dfb4 Add fix to reflect.typeid_elem 2025-04-11 22:24:19 +02:00
gingerBill
e38a08013e Remove #relative types from the compiler 2024-11-14 16:17:24 +00:00
Laytan Laats
9c374b4d02 reflect: add enum_value_has_name proc
Easy way to check if the current value has a defined name/member in the
enum type.
2024-11-11 18:56:59 +01:00
Jeroen van Rijn
8ad4427a25 Add a few more reflect.bit_field_* helpers. 2024-08-30 22:40:14 +02:00
Jeroen van Rijn
db3bcd2cea Add reflect.bit_fields_zipped 2024-08-30 22:04:10 +02:00
unknown
ae5ef0ce9c fix core:reflect/iterator.odin 2024-08-24 16:01:49 -04:00
Laytan Laats
dec97cbddb fix type_info_union_is_pure_maybe only working with regular pointers
Fixes #3996
2024-08-11 21:07:21 +02:00
Jeroen van Rijn
17ebaffce8 Update comment. 2024-08-05 22:12:22 +02:00
Jeroen van Rijn
4902288a5a Add reflect.struct_field_count that returns the number of fields in a struct type
Example:
```odin
package struct_count_example

import "core:fmt"
import "core:reflect"
import "core:dynlib"

Foo :: struct{
	one: int,
	two: f32,
}

Bar :: struct {
	three: int,
	four:  bool,
	five:  f64,
}

Game_Api :: struct {
	init:      proc(api: ^Game_Api),
	update:    proc(api: ^Game_Api),

	using foo: Foo,
	bar:       Bar,

	// Private stuff
	reload_count: int,
	__handle:     rawptr,
}
API_PRIVATE_COUNT :: 2

game_api: Game_Api

main :: proc() {
	fmt.printfln("Game_Api, .Top:       %v", reflect.struct_field_count(Game_Api))              // 6
	fmt.printfln("Game_Api, .Using:     %v", reflect.struct_field_count(Game_Api, .Using))      // 8
	fmt.printfln("Game_Api, .Recursive: %v", reflect.struct_field_count(Game_Api, .Recursive))  // 11

	symbols_loaded, _  := dynlib.initialize_symbols(&game_api, "game.dll")
	symbols_expected   := reflect.struct_field_count(Game_Api) - API_PRIVATE_COUNT

	if symbols_loaded == -1 {
		fmt.eprintln("Couldn't load game.dll")
		return
	} else if symbols_loaded != symbols_expected {
		fmt.eprintfln("Expected %v symbols, got %v", symbols_expected, symbols_loaded)
		return
	}
}
```
2024-08-05 22:04:16 +02:00
Laytan Laats
3e618bed40 fix reflect.any_base and reflect.any_core with any's containing nil 2024-07-22 00:51:38 +02:00
gingerBill
1c3240b6b5 Add #force_no_inline 2024-07-14 23:09:58 +01:00
gingerBill
399c3ab067 Reduce the size of runtime.Type_Info 2024-07-14 21:37:35 +01:00
gingerBill
45b2a6a19e Fix reflect.as_pointer 2024-07-04 13:37:47 +01:00
gingerBill
e296d6fb90 Fix loads of indentation issues with mixing spaces and tabs 2024-06-29 19:50:51 +01:00
gingerBill
c752d0b541 Fix printing of big endian integers in a bit_field 2024-04-27 09:16:18 +01:00
gingerBill
d5e6d722d3 Merge pull request #3045 from laytan/cbor
encoding/cbor
2024-04-15 14:28:52 +01:00
gingerBill
a750fc0ba6 Add #row_major matrix[R, C]T
As well as `#column_major matrix[R, C]T` as an alias for just `matrix[R, C]T`.
This is because some libraries require a row_major internal layout but still want to be used with row or major oriented vectors.
2024-03-19 21:05:23 +00:00
Laytan Laats
317931a3c5 encoding/cbor: deterministically store bit sets as big endian 2024-03-04 17:26:19 +01:00
gingerBill
a4b8c1ea17 Begin work adding bit_field 2024-02-22 15:55:54 +00:00
gingerBill
8472338bfa Add reflect.enum_name_from_value and reflect.enum_name_from_value_any 2024-02-21 12:43:09 +00:00
gingerBill
3e7e779abf Replace core:* to base:* where appropriate 2024-01-28 22:18:51 +00:00
gingerBill
ddcaa0de53 Remove core:mem dependency from core:reflect 2024-01-28 20:52:01 +00:00
gingerBill
30636f5114 Change return values from Struct_Tag to string 2024-01-28 15:48:19 +00:00
gingerBill
2cc22d118d Require parentheses for #align(N) 2023-08-15 14:55:02 +01:00
gingerBill
c91898a888 Remove #relative slices; Replace with #relative multi-pointers 2023-08-05 16:05:39 +01:00
gingerBill
3dec55f009 Replace x in &y Use &v in y syntax through core & vendor for switch/for statements 2023-06-26 15:42:57 +01:00
gingerBill
296674e18b Rename ODIN_DISALLOW_RTTI to ODIN_NO_RTTI; Remove dead command line flags 2023-06-12 14:53:05 +01:00
jakubtomsu
65bf7f6653 Remove typo 2023-04-23 20:00:25 +02:00
gingerBill
0b064765c9 Add reflect.struct_field_value 2023-03-17 11:47:39 +00:00
gingerBill
6179d4feb1 Rename to Type_Info_Parameters 2023-02-08 11:23:21 +00:00
gingerBill
4cb16db4e9 Remove @(require_results) from one procedure 2023-01-30 12:51:56 +00:00
gingerBill
8d43cc840a Add @(require_results) to package reflect 2023-01-29 11:28:05 +00:00