Rikard Petré
6a6f078186
Fix missing closing brace for Bit_Field in core:odin/parser
2024-08-06 19:48:38 +02:00
gingerBill
bed18a17e6
Bodge: Improve aligned_resize logic
2024-08-06 11:22:34 +01: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
a1c3c38f04
Merge pull request #4029 from Feoramund/fix-darwin-sigpipe-send
...
Prevent `SIGPIPE` on Darwin when writing to a closed `core:net` socket
2024-08-05 19:26:16 +02:00
Feoramund
4c0ab09c9a
Handle EPIPE in Darwin core:net
2024-08-05 13:15:08 -04:00
Feoramund
6cc7f3b451
Add FreeBSD Accept_Error.Would_Block alias
2024-08-05 13:00:44 -04:00
Feoramund
3512d7c672
Move Darwin MSG_NOSIGNAL to core:os
2024-08-05 12:49:12 -04:00
Feoramund
eba0774bf3
Prevent SIGPIPE on Darwin when writing to a closed core:net socket
...
Mimics behavior found on Linux implementation.
2024-08-05 12:23:09 -04:00
gingerBill
7c3461b0df
Merge pull request #4028 from Kelimion/fix-4026
...
Fix crash if referencing import "aliased" in other file.
2024-08-05 16:57:58 +01:00
Jeroen van Rijn
2cc3795686
Merge pull request #4027 from karl-zylinski/blend-pixel-compile-fix
...
Fix for blend_pixel.odin in core/image/common.odin not compiling
2024-08-05 17:38:30 +02:00
Karl Zylinski
b63657d293
Fix for blend_pixel.odin in core/image/common.odin not compiling
2024-08-05 17:23:58 +02:00
Jeroen van Rijn
6175efde3d
Fix crash if referencing import "aliased" in other file.
...
Fixes #4026
2024-08-05 17:23:50 +02:00
Jeroen van Rijn
030220eb22
Merge pull request #4025 from karl-zylinski/patch-2
...
core/image/common.odin compile fix
2024-08-05 16:42:09 +02:00
Karl Zylinski
2d32b819dc
common.odin compile fix
...
Fix for "Error: Prefer to separate 'where' clauses with a comma rather than '&&'"
2024-08-05 16:32:34 +02:00
gingerBill
f56abf3780
Add intrinsics.masked_expand_load and intrinsics.masked_compress_store
2024-08-05 14:54:09 +01:00
gingerBill
78919f8524
Fix typos
2024-08-05 14:48:55 +01:00
gingerBill
80ea4e0aeb
Remove dead code
2024-08-05 14:25:33 +01:00
gingerBill
84ac56f778
Add intrinsics.simd_masked_load and intrinsics.simd_masked_store
2024-08-05 14:08:41 +01:00
gingerBill
7e701d1677
Add intrinsics.simd_gather and `intrinsics.simd_scatter
2024-08-05 13:46:24 +01:00
gingerBill
b67ed78afd
add_sat -> saturating_add
2024-08-05 13:21:27 +01:00
gingerBill
90fc52c2ee
Rename add_sat -> saturating_add
2024-08-05 13:19:01 +01:00
gingerBill
9a01a13914
Add simd_reduce_any and simd_reduce_all
2024-08-05 13:13:19 +01:00
gingerBill
eeb92e2644
Allow cast between #simd[N]rawptr <-> #simd[N]uintptr
2024-08-05 13:06:55 +01:00
gingerBill
fd06be2243
Allow swizzle to take more arguments than the original array length
2024-08-05 12:33:02 +01:00
gingerBill
a06cb8ba46
Add #simd[N]rawptr support
2024-08-05 12:04:36 +01:00
Feoramund
d0d4f19097
Remove debug line from test
2024-08-05 03:50:41 -04:00
Feoramund
8f5b838a07
Review manual for loops in core:text/regex
2024-08-05 03:49:29 -04:00
Feoramund
ba0581ae79
Give FreeBSD access to core:net in core:flags
2024-08-05 03:05:50 -04:00
Feoramund
d9404d928c
Add copyright info to core:sys/freebsd
2024-08-05 03:05:50 -04:00
Feoramund
fe754af13d
Add new contribution notes to core:net
2024-08-05 03:05:49 -04:00
Feoramund
61e770d943
Clean up some FreeBSD core:net code
2024-08-05 03:05:43 -04:00
Feoramund
2b63684ccf
Fix integer socket option values for FreeBSD
2024-08-05 02:14:41 -04:00
Feoramund
5ece6980eb
Make EINVAL generic in FreeBSD Socket_Option_Error
...
The documentation for `setsockopt(2)` mentioned accept filters for
`EINVAL`, but I've found that it can arise for any manner of invalid
values for setting socket options.
We'll just have to leave this as a generic error.
2024-08-05 02:14:27 -04:00
Feoramund
42a2297d31
Add core:net tests specifically for FreeBSD
2024-08-05 02:08:48 -04:00
Feoramund
8de48d81ea
Use common name for ENOBUFS
2024-08-05 00:30:39 -04:00
Feoramund
32fb1fb61c
Add missing ECONNRESET TCP_Send_Error
...
This was not specifically documented in `send(2)`.
2024-08-05 00:30:39 -04:00
Feoramund
05c50561ae
Set NOSIGPIPE on all core:net FreeBSD sockets
2024-08-05 00:30:39 -04:00
Feoramund
46455dd0a6
Add more socket options for FreeBSD core:net
2024-08-05 00:30:24 -04:00
Feoramund
3f9ddfe029
Clarify what umtx is
2024-08-04 22:24:55 -04:00
Feoramund
14858309f0
Add explicit license info to core:text/regex
2024-08-04 19:18:16 -04:00
Feoramund
e17fc8272b
Document rationale behind RegEx shorthand classes
2024-08-04 19:12:46 -04:00
Feoramund
dde42f0ebc
Add more documentation for core:text/regex API
2024-08-04 18:56:29 -04:00
Feoramund
ca7e46d56f
Add explicit test case for Capture pos
2024-08-04 18:56:29 -04:00
Feoramund
743480b1a4
Use regex.destroy for test captures
2024-08-04 18:56:29 -04:00
Feoramund
1ccb0b2558
Remove unused code
2024-08-04 18:56:29 -04:00
Feoramund
babdc432e9
Move Flag_To_Letter to core:text/regex/common
2024-08-04 18:56:25 -04:00
Feoramund
d3a51e208d
Hide Regular_Expression values
...
We don't directly support printing these.
To prevent future issues being raised about the pattern being missing if
someone tries to print one, hide everything.
2024-08-04 18:40:27 -04:00
Feoramund
cd8272557f
Test that a RegEx Capture pos corresponds to its groups
2024-08-04 18:33:36 -04:00
gingerBill
7e0fa795e4
Just compare against nil directly if the comparator is known to be nil too
2024-08-04 21:17:58 +01:00