Laytan Laats
85b71708dd
dynlib: add last_error procedure
2024-01-06 02:08:11 +01:00
Jeroen van Rijn
649b5fa528
Add bool return to dynlib.initialize_symbols.
2024-01-06 02:04:09 +01:00
Jeroen van Rijn
d6a89d667d
Add dynlib.initialize_symbols ( #3071 )
...
```
package example
import "core:dynlib"
import "core:fmt"
Symbols :: struct {
// `foo_` is prefixed, so we look for the symbol `foo_add`.
add: proc "c" (int, int) -> int,
// We use the tag here to override the symbol to look for, namely `bar_sub`.
sub: proc "c" (int, int) -> int `dynlib:"bar_sub"`,
// Exported global (if exporting an i32, the type must be ^i32 because the symbol is a pointer to the export.)
// If it's not a pointer or procedure type, we'll skip the struct field.
hellope: ^i32,
// Handle to free library.
// We can have more than one of these so we can match symbols for more than one DLL with one struct.
_my_lib_handle: dynlib.Library,
}
main :: proc() {
sym: Symbols
// Load symbols from `lib.dll` into Symbols struct.
// Each struct field is prefixed with `foo_` before lookup in the DLL's symbol table.
// The library's Handle (to unload) will be stored in `sym._my_lib_handle`. This way you can load multiple DLLs in one struct.
count := dynlib.initialize_symbols(&sym, "lib.dll", "foo_", "_my_lib_handle")
defer dynlib.unload_library(sym._my_lib_handle)
fmt.printf("%v symbols loaded from lib.dll (%p).\n", count, sym._my_lib_handle)
if count > 0 {
fmt.println("42 + 42 =", sym.add(42, 42))
fmt.println("84 - 13 =", sym.sub(84, 13))
fmt.println("hellope =", sym.hellope^)
}
}
```
2024-01-06 01:31:27 +01:00
gingerBill
b408ec6bac
Remove distinct from the specific types
2024-01-05 14:48:39 +00:00
gingerBill
3bf7b416e7
Fix builtin.quaternion generation
2024-01-05 14:36:58 +00:00
gingerBill
0b83e3dae5
Enforce naming the parameters with builtin.quaternion to reduce confusion
2024-01-05 14:29:14 +00:00
Jeroen van Rijn
b59c80d6fd
Merge pull request #3068 from laytan/json-unmarshal-union
...
encoding/json: try to unmarshal into union variants
2024-01-03 19:13:36 +01:00
Laytan Laats
8c10f4cdde
encoding/json: try to unmarshal into union variants
2024-01-03 19:02:30 +01:00
Laytan Laats
8a7c2ea9d0
darwin: actually honor no-crt by not linking with -lSystem -lm
2024-01-02 21:44:51 +01:00
Jeroen van Rijn
4efef08c94
Update core:encoding to Unicode 15.1 table.
2024-01-02 18:03:32 +01:00
gingerBill
87c835268a
Merge pull request #2917 from flysand7/sys-linux-additions
...
[sys/linux]: Fixes and additions
2024-01-02 14:23:40 +00:00
gingerBill
76eef47491
Merge pull request #3054 from igordreher/win_error
...
[core:sys/windows] add System Error Codes enum
2024-01-02 14:16:36 +00:00
Alex Ragalie
b47736260a
remove duplication
2023-12-31 21:57:39 +01:00
Jeroen van Rijn
89084befb0
Remove unnecessary []byte -> []byte conversion.
2023-12-30 21:59:33 +01:00
Igor Dreher
120b1101fb
[core:sys/windows] add System Error Codes enum
...
Copied error values from https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-
and subsequent pages to an enum
2023-12-29 11:06:50 -03:00
Laytan Laats
1fa2af213d
fix typo in assign_at_elems
2023-12-28 17:10:08 +01:00
Jeroen van Rijn
e52cc73d50
Fix generic_float.odin
2023-12-21 22:37:26 +01:00
gingerBill
464a675adc
Merge branch 'master' of https://github.com/odin-lang/Odin
2023-12-21 17:05:31 +00:00
gingerBill
55f3e99f63
Fix %g in fmt, and make %v default to %g for floats
2023-12-21 17:05:24 +00:00
Laytan Laats
46250168d6
use stack buffer for log allocator to avoid logging it's own allocations
2023-12-19 23:26:23 +01:00
gingerBill
829e4cc67e
Fix assign_at_elems to match the same logic as assign_at_elem_string
2023-12-18 22:22:08 +00:00
Laytan
baa5ea9258
fix not passing arg everywhere
2023-12-18 16:41:55 +01:00
Laytan
9a490e4e0d
fix big alignment
2023-12-18 16:38:51 +01:00
Laytan Laats
252de70b0f
fix same problem in virtual arena
2023-12-18 15:41:36 +01:00
Laytan Laats
4ae021cd4c
add other failing test and fix them
2023-12-18 15:17:27 +01:00
Yawning Angel
29c80c238d
core: Fixed build constraints
...
Multiple constraints on the same line are combined with logical OR,
while combining multiple negated constraints needs to be done with
logical AND (each constraint on a separate line).
2023-12-17 23:02:46 +09:00
Laytan Laats
58ff3dd1ed
log allocator: add option to switch between bytes and human format
2023-12-16 01:27:38 +01:00
Laytan Laats
cf8c9a6be4
log allocator: fix the formatting for query info/features and errors
2023-12-16 00:55:59 +01:00
Laytan Laats
ea709451e8
log allocator: use %m to format size
2023-12-15 23:43:35 +01:00
gingerBill
2e9298891e
Merge pull request #3019 from DanielGavin/parser-fix
...
Fixed crash in `core:odin/parser` with `#reverse`
2023-12-14 15:16:01 +00:00
Lucas Perlind
12b8f91249
Format hidpi.odin
2023-12-14 10:29:50 +11:00
DanielGavin
8e395cc6e9
Fixed crash in core:odin/parser with #reverse
2023-12-13 20:08:26 +01:00
gingerBill
6e9e469abd
Merge pull request #3008 from laytan/fix-stat-struct-layout-linux-arm64
...
fix struct stat layout linux arm64
2023-12-13 15:24:38 +00:00
gingerBill
0490ba46f4
Merge pull request #3015 from Lperlind/master
...
Add Hidpi to Windows
2023-12-13 15:24:25 +00:00
gingerBill
173527d631
Remove random tag
2023-12-13 01:53:15 +00:00
gingerBill
f8cb2bcad2
Add slice.unique and slice.unique_proc
2023-12-13 01:50:26 +00:00
gingerBill
b011487778
Reimplement binary_search_by to be simpler
2023-12-13 01:37:15 +00:00
gingerBill
c8cc130744
Fix the implementation of binary_search_by to work with a normal ordering call, rather than the backwards version.
...
WHY THE HECK WAS IT THIS WAY IN THE FIRST PLACE?!
2023-12-13 01:24:03 +00:00
gingerBill
fe0244606b
Revert
2023-12-13 01:20:53 +00:00
gingerBill
036fa6482c
Use cmp_proc in binary_search
2023-12-13 01:18:05 +00:00
gingerBill
04ca22b9ea
Add to core:slice reduce_reverse, filter_reverse, repeat
2023-12-13 00:35:23 +00:00
Lucas Perlind
e410908ce8
Add Hidpi to Windows
2023-12-12 12:14:18 +11:00
Laytan Laats
d278c852cc
clean up field names
2023-12-08 23:43:30 +01:00
Matija Dizdar
843b2350eb
added #no_bounds_check back into binary_search_by
2023-12-06 21:48:37 +01:00
Matija Dizdar
526d338300
removed incorrect requirement for key type to be ordered in binary_search_by
2023-12-06 21:29:18 +01:00
Laytan Laats
a6aca5d6d1
fix struct stat layout linux arm64
2023-12-06 17:17:45 +01:00
gingerBill
31b1aef44e
Merge pull request #3003 from karl-zylinski/patch-1
...
virtual arena: Actually use DEFAULT_ARENA_STATIC_RESERVE_SIZE as default value on arena_init_static
2023-12-05 16:04:25 +00:00
flysand7
5665ae02bc
type error
2023-12-06 00:33:09 +11:00
flysand7
92d3a681cd
Merge branch 'master' into sys-linux-additions
2023-12-06 00:23:41 +11:00
flysand7
cb66ed52ce
[sys/linux]: Fix epoll_wait on arm64
2023-12-06 00:09:10 +11:00