Commit Graph

15401 Commits

Author SHA1 Message Date
Feoramund
649376fcfe Add require_results to getters in os2 path API 2025-03-21 19:14:15 -04:00
Feoramund
cfa3e97968 Make os2 Linux _is_path_separator compare against _Path_Separator 2025-03-21 19:14:15 -04:00
Feoramund
6a6980fda8 Remove if ODIN_OS == .Windows in file that can only be built on Windows 2025-03-21 19:14:15 -04:00
Feoramund
3525e71739 Add tests for new os2 path API 2025-03-21 19:14:15 -04:00
Feoramund
4e7f54c565 Decouple usage of filepath from os2 2025-03-21 19:14:15 -04:00
Feoramund
abe0c30837 Add new path API for os2 2025-03-21 19:14:15 -04:00
Laytan Laats
cf0f73e0cf fix typo for freebsd arm64 MINSIGSTKSZ
Fixes #4878
2025-03-21 23:52:52 +01:00
Laytan Laats
73fd564634 fix tabs 2025-03-21 23:02:00 +01:00
Laytan Laats
f85db012b8 fix off by one temp cstring and put objc names on permanent allocator to be safe
Fixes #4922
2025-03-21 22:56:19 +01:00
gingerBill
69b969ef7f Merge pull request #4953 from openhood/wasm-prevent-duplicate-event-listeners
Prevent registering the same event listener twice on the same element with the exact same data in wasm.
2025-03-21 21:34:03 +00:00
Laytan Laats
057144dea3 fix linux release trying to use non-existant llvm 20 package 2025-03-21 21:47:40 +01:00
Jonathan Tron
2bccd07426 Prevent registering the same event listener twice on the same element with the exact same data in wasm. 2025-03-21 09:38:23 +01:00
Feoramund
d1d86234aa Add missing documentation to os2/path 2025-03-20 18:36:26 -04:00
gingerBill
631406eecc Merge pull request #4951 from openhood/wasm-fix-remove-event-listeners
Fix add/remove event listeners in `core:sys/wasm`
2025-03-20 21:31:38 +00:00
Feoramund
a495cd581c Assert that _Path_Separator is 7-bit ASCII
There are several places where this is assumed to be true, most visibly
in `is_path_separator`, as it takes a `byte` argument.

Note that the data type of `_Path_Separator` is a rune, which allows any
Unicode value.
2025-03-20 14:43:54 -04:00
gingerBill
539e9bd2e3 Merge pull request #4836 from laytan/fix-wrong-out-of-memory
fix wrong out of memory in edge cases, just try allocate from block for one source of truth
2025-03-20 17:20:26 +00:00
Laytan Laats
badd2c90f9 drop llvm 19 feature/microarch table
There was a bug in LLVM 19 introduced in https://github.com/llvm/llvm-project/pull/96249 and fixed in https://github.com/llvm/llvm-project/pull/118581.

Lets just use the LLVM 18 table for LLVM 19.
2025-03-20 16:51:27 +01:00
Jonathan Tron
dbe53d053a Fix add/remove event listeners in core:sys/wasm
There were multiple issues here:

1. listeners stored in the same key overwriting the previous one
2. missing `use_capture` parameter in `remove_event_listener`/`remove_window_event_listener`

The key used to store the listener function in `listenerMap` was a
javascript `Object`, when used as a key it was thus serialized to
the string `"[object Object]"`, meaning all listeners where effectively
set to the same key when calling `add_event_listener`/`add_window_event_listener`.
Later on when calling `remove_event_listener`/`remove_window_event_listener`,
it then tried to remove the incorrect one or none at all if there was a
mix of the same event name registered on an element or the window.

To fix I implemented a function `listener_key` in the javascript code
which will generate a different key based on the event's:
- `id`: dom element's id or 'window' (when event listener added to the
  window)
- `name`: the event name (eg: `click`), each event handler should be
  removed for the event name it was register on.
- `data`: we can register events with different data, each one generate
  a new listener which has to be removed.
- `callback`: same as `data`, if you register two similar handler but
  with two different callback, each one should be removed.
- `useCapture`: this one is a bit tricky, but when you register an event
  handler in javascript, if you don't pass `useCapture`, it defaults to `false`.
  When you remove an handler, you have to pass the exact same
  `useCapture` option you registered it with. In this case, we allowed
  to register an event with different `useCapture`, but didn't allow to
  pass the `useCapture` when removing it. We always called `removeEventListener`
  without the `useCapture` parameter which removed the handler properly
  only when it was registered with `useCapture=false`.

I also switched the `WasmMemoryInterface.listenerMap` from `{}`
(javascript object) to a `new Map()`, which is available everywhere
nowadays.
2025-03-20 16:43:49 +01:00
gingerBill
0f01b34b38 Merge pull request #4948 from laytan/llvm-20-plus
few llvm 20 changes
2025-03-19 23:19:17 +00:00
Laytan Laats
f80e73e036 few llvm 20 changes 2025-03-19 21:22:55 +01:00
gingerBill
067442ee32 Merge pull request #4945 from odin-lang/llvm-20
Update to LLVM 20.1.0
2025-03-19 10:16:31 +00:00
gingerBill
8e84933fe9 Use 18 for RISCV64 2025-03-19 09:23:15 +00:00
gingerBill
f13fc27ae0 Use LLVM-18 on FreeBSD 2025-03-18 16:53:10 +00:00
gingerBill
de14aa510b Use LLVM-18 on macOS Intel 2025-03-18 16:46:54 +00:00
gingerBill
809ee42873 Fix typo in passes 2025-03-18 16:46:15 +00:00
gingerBill
f2b962a492 Use LLVM-18 for macOS ARM 2025-03-18 16:41:25 +00:00
gingerBill
b2376d05a6 Fix typo 2025-03-18 16:39:08 +00:00
gingerBill
cf982fc222 Update to LLVM 20 in CI. 2025-03-18 16:35:55 +00:00
gingerBill
4c3c3a0631 Add new LLVM 20 passes 2025-03-18 16:21:08 +00:00
gingerBill
d209af5094 Update to LLVM 20.1.0 2025-03-18 15:39:18 +00:00
dozn
3148acf6a6 [core:encoding/json] When Unmarshalling, Only Match Struct Tags If Present 2025-03-17 01:51:04 -07:00
gingerBill
0c70ec0330 Merge pull request #4934 from laytan/vendor-libc-additions
vendor/libc: a bunch of additions
2025-03-13 09:23:20 +00:00
gingerBill
408b3af550 Merge pull request #4933 from laytan/js-open-binding
core/sys/wasm/js: add `open` binding to `window.open`
2025-03-13 09:22:20 +00:00
gingerBill
35340de928 Merge pull request #4932 from laytan/js-pointer-event-and-charcode
core/sys/wasm/js: add pointer event info and add charCode to keyboard
2025-03-13 09:22:03 +00:00
gingerBill
5a12190f51 Merge pull request #4931 from laytan/webgl-improvements
webgl: add `BlendEquationSeparate` and `GetParameter4i`
2025-03-13 09:21:44 +00:00
gingerBill
9b7aebe2b6 Merge pull request #4930 from laytan/js-gamepad-improvements
core/sys/wasm/js: improve gamepad API
2025-03-13 09:21:15 +00:00
Laytan Laats
140c902eff vendor/libc: a bunch of additions
All these additions are to allow Dear ImGui to be compiled natively.
2025-03-12 19:25:35 +01:00
Laytan Laats
6691acfa03 core/sys/wasm/js: add open binding to window.open 2025-03-12 18:43:03 +01:00
Laytan Laats
b76fd84084 webgl: add BlendEquationSeparate and GetParameter4i
`GetParameter4i` can be used to retrieve the current scissor rect, or
the curent viewport, which was previously impossible.

Also adds `BlendEquationSeparate` which seemed to be missing.

Also removes an instance of `do`.
2025-03-12 18:39:57 +01:00
Laytan Laats
00ac48c06c core/sys/wasm/js: add pointer event info and add charCode to keyboard events 2025-03-12 18:37:42 +01:00
Laytan Laats
d349c96071 core/sys/wasm/js: improve gamepad API
1. Properly set `id` and `mapping` on the `get_gamepad_state` result
2. Increase `id` limit to 96 bytes, connecting my DualShock 4 made it crash
3. If an `id` or `mapping` is longer than the limits, slice it and add `...`
2025-03-12 18:32:51 +01:00
gingerBill
d3b1aaad18 Use :: rather than $ to try and fix mac SEL stuff 2025-03-12 12:53:26 +00:00
gingerBill
d5fe392edd Merge pull request #4927 from voutilad/openbsd-futex
Fix futex(2) usage on OpenBSD.
2025-03-11 15:51:57 +00:00
gingerBill
d15be94a0f Remove debug print 2025-03-11 15:50:46 +00:00
gingerBill
6e1c21411d Fix object name generation 2025-03-11 15:50:31 +00:00
gingerBill
ffef302543 Merge pull request #4925 from jasonKercher/fix-sigaction
Fix linux.rt_sigaction
2025-03-11 15:45:16 +00:00
Dave Voutila
0059507374 Fix futex(8) usage on OpenBSD. 2025-03-11 10:28:48 -04:00
jason
ae02ced175 Fix linux.rt_sigaction
Add missing polymorphic parameter to Sig_Action
2025-03-10 20:27:59 -04:00
gingerBill
1035f0839d Merge pull request #4915 from chuga-git/sdl3-get-pixel-format-name
vendor/sdl3: fix GetPixelFormatName() returning rawptr instead of cstring
2025-03-10 17:29:46 +00:00
gingerBill
6837e23e73 Merge pull request #4919 from latedeployment/add-linux-syscalls
Add missing x86 syscalls from map_shadow_stack to removexattrat
2025-03-10 17:29:32 +00:00