Commit Graph
13175 Commits
Author SHA1 Message Date
Satoshi Somaandflysand7 362086d5d2 Fix: build_odin.sh always runs demo regardless of argument
Instead, it should run demo only if the argument was 'debug' or empty
2024-12-01 11:54:53 +11:00
Bazzagibbsandflysand7 25be3dfca0 Add core:slice.size to get the byte size of a slice's backing data 2024-12-01 11:54:53 +11:00
bayo-codeandflysand7 7bd49cf018 Added support for odin build -target:? 2024-12-01 11:54:53 +11:00
bayo-codeandflysand7 9fbde3c1b8 Revert "List the supported targets using odin targets"
This reverts commit b589e3c499.
2024-12-01 11:54:53 +11:00
bayo-codeandflysand7 c73c438db9 List the supported targets using odin targets 2024-12-01 11:54:53 +11:00
Doeke Wartenaandflysand7 bbb1400349 Update demo.odin
type: turns -> returns
2024-12-01 11:54:53 +11:00
Jacob Pfeifferandflysand7 a8d603fd7d Correct zlib usage in doc 2024-12-01 11:54:53 +11:00
AP Darklyandflysand7 f56cc069c5 fix relative links in examples/README.md
This fix adjusts the links for 'demo', 'core', 'all', and 'vendor' so that they navigate to the intended destinations instead of yielding 404s.
2024-12-01 11:54:53 +11:00
Doeke Wartenaandflysand7 cc1c97c6d0 Update scanner.odin
remove duplicated wording in comment
2024-12-01 11:54:53 +11:00
gingerBillandflysand7 ddca55165d Remove duplicates in -defineables 2024-12-01 11:54:53 +11:00
A1029384756andflysand7 943b09a8b1 added unlinking section to posix socket binding documentation 2024-12-01 11:54:53 +11:00
Jeroen van Rijnandflysand7 826abd6245 && 2024-12-01 11:54:53 +11:00
Jeroen van Rijnandflysand7 d44f8c377a Phrasing! 2024-12-01 11:54:53 +11:00
Jeroen van Rijnandflysand7 9ecc378803 Suggest -microarch:native if popcnt instruction is missing.
Fixes #4453.
2024-12-01 11:54:53 +11:00
nickk-dvandflysand7 1e600d74f1 fix LoadRandomSequence binding in vendor raylib 2024-12-01 11:54:53 +11:00
Morten Hauke Solvangandflysand7 6c750c6670 Suggestion when assigning enum to bit_set 2024-12-01 11:54:53 +11:00
Dominik Pötzschkeandflysand7 a71832570c added braces 2024-12-01 11:54:53 +11:00
Dominik Pötzschkeandflysand7 f37ec05548 adjust memory allocation 2024-12-01 11:54:52 +11:00
Dominik Pötzschkeandflysand7 841996435b fix: fix windows params bug 2024-12-01 11:54:52 +11:00
gingerBillandflysand7 11768c6217 Minor formatting change 2024-12-01 11:54:52 +11:00
Colin Davidsonandflysand7 514faa517e oops, missed a comma 2024-12-01 11:54:52 +11:00
Colin Davidsonandflysand7 3b4338b685 add new test, better fail-check, and non-transitioning tz fix 2024-12-01 11:54:52 +11:00
0dminnimdaandflysand7 24ec0f0ebf Revert further simplifiction 2024-12-01 11:54:52 +11:00
0dminnimdaandflysand7 a7f32109e8 Simplify further 2024-12-01 11:54:52 +11:00
0dminnimdaandflysand7 4f37b34654 Simplify use of pie 2024-12-01 11:54:52 +11:00
0dminnimdaandflysand7 480f32586e Add support for linking as pie 2024-12-01 11:54:52 +11:00
gingerBillandflysand7 619b382635 Fix previous commit for arrays 2024-12-01 11:54:52 +11:00
gingerBillandflysand7 50e46326a6 Fix bug for foo().bar where foo() is a 0-value expression 2024-12-01 11:54:52 +11:00
gingerBillandflysand7 fafac1bc77 Fix auto_cast matrix bug 2024-12-01 11:54:52 +11:00
gingerBillandflysand7 d5b6c25686 Fix #4406 os2 to not close the std file handles but rather just free the memory for the ^File data. 2024-12-01 11:54:52 +11:00
NicknEmaandflysand7 1b7a32f76c Mark procs as "contextless" in winerror.odin
So that they can be called from places like the windproc and stuff.
2024-12-01 11:54:52 +11:00
Jeroen van Rijnandflysand7 1a13322cd7 Missing paren. 2024-12-01 11:54:52 +11:00
Jeroen van Rijnandflysand7 c5d3fdca44 mem.is_aligned is in bytes, not log2 bytes
Fix formula and clarify comment
2024-12-01 11:54:52 +11:00
p2jasonandflysand7 ee84aa4ead Removed event hook callback from add_*_event_listener functions 2024-12-01 11:54:52 +11:00
p2jasonandflysand7 f993fcb82c Removed event queue from add_*_event_listener JS functions and added event hook callback 2024-12-01 11:54:52 +11:00
p2jasonandflysand7 aa08f661ca Changed boolean parameters to bit set in the add_*_event_listener functions 2024-12-01 11:54:52 +11:00
p2jasonandflysand7 0eac9f15bc Added parameters to the add_*_event_listener JS functions for stopping event behavior 2024-12-01 11:54:52 +11:00
Laytan Laatsandflysand7 9adc7f2bcf fix tabs 2024-12-01 11:54:52 +11:00
Laytan Laatsandflysand7 6866e69cb9 add time/timezone to docs 2024-12-01 11:54:52 +11:00
Laytan Laatsandflysand7 9735f8a0ba add CoreFoundation and Security to docs 2024-12-01 11:54:52 +11:00
Laytan Laatsandflysand7 7b63abdba3 add kqueue to docs 2024-12-01 11:54:52 +11:00
Laytan Laatsandflysand7 e6d324c5c4 testing: separate the posix import into target files
This is needed for the docs generator to generate all the docs for the
posix package, if it is imported like it was on Windows it would
generate docs for the Windows version of the package which has much less
symbols exposed.
2024-12-01 11:54:52 +11:00
Barinzayaandflysand7 6fa646cbf1 Fixed raymath not applying matrix translations.
Translation matrices use the w components of the matrix to apply the
transform, and thus only work when the w component is 1. In the
original raymath implementation, the multiplication is done manually
and adds the translation components directly to the result, as if w is
1, but in the Odin binding this is done with a matrix multiplication.
However, the w component is set to 0 instead of 1, resulting in the
translation not being applied.
2024-12-01 11:54:52 +11:00
peachey2k2andflysand7 186499c8af Add "-build-mode:dynamic" to the "odin help build" output 2024-12-01 11:54:52 +11:00
Laytan Laatsandflysand7 c08408ea08 fix thread_unix for Darwin after pthread corrections in posix package
afed3ce removed the sys/unix package and moved over to sys/posix, it has
new bindings for the pthread APIs but should have been equivalent (not).

8fb7182 used `CANCEL_ENABLE :: 0`, `CANCEL_DISABLE :: 1`, `CANCEL_DEFERRED :: 0`, `CANCEL_ASYNCHRONOUS :: 1` for Darwin, while the
correct values are `1`, `0`, `2` and `0` respectively (same mistake was made for
FreeBSD in that commit).

What this meant is that the
`pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS)` was not actually
successful, but because the error wasn't checked it was assumed it was.
It also meant `pthread_setcancelstate(PTHREAD_CANCEL_ENABLE)` would
actually be setting `PTHREAD_CANCEL_DISABLE`.

The code in this PR restores the behaviour by now actually deliberately
setting `PTHREAD_CANCEL_DISABLE` and not setting
`PTHREAD_CANCEL_ASYNCHRONOUS` which was the previous behaviour that does
actually seem to work for some reason.

(I also fixed an issue in fmt where `x` would use uppercase if it was a
pointer.)
2024-12-01 11:54:52 +11:00
bobsayshilolandflysand7 96e6393614 Plug a memory leak
The call to |array_make()| always allocates and since this variable was
unused it lead to a leak. Simply plug it by removing it.
2024-12-01 11:54:52 +11:00
bobsayshilolandflysand7 73b6461710 Add missing guards around push/pop pragmas
This matches all the other places where we silence Windows warnings.
2024-12-01 11:54:52 +11:00
bobsayshilolandflysand7 56094f3580 Fix passing nullptr to args marked as non-null
libstdc++'s |memcpy| and |memset| both state that their inputs should
never be a nullptr since this matches the C spec. Some compilers act on
these hints, so we shouldn't unconditionally call these as it would
signal to the compiler that they can't be nullptrs.

As an example, the following code will always call |do_something()|
when compiled with optimisations since GCC version 4.9:
```
    void clear(void *ptr, int size) {
        memset(ptr, 0, size);
    }
    void example(void *ptr, int size) {
        clear(ptr, size);
        if (ptr != nullptr) do_something();
    }
```
2024-12-01 11:54:52 +11:00
bobsayshilolandflysand7 30fb2ed59d Avoid undefined arithmetic shifting
The result of a left shift on a positive signed integer (Rune) must fit
into an unsigned integer otherwise it's undefined behaviour, as is left
shifting a negative integer by any amount. This code can only be hit if
|x >= 0xf0| and hence a left shift of 31 will always be undefined
unless the input is 0 or 1.

To avoid hitting this we can instead extend the lowest bit to be the
mask if we assume that ints are 2's complement, which we already do
elsewhere. This generates identical code in testing on Compiler
Explorer and the Odin test suite passes locally with this change.

Note that the original code would change to be defined behaviour in
C++20, however we are currently build with |-std=c++14| in the build
scripts.
2024-12-01 11:54:51 +11:00
bobsayshilolandflysand7 ddde456af7 Avoid member access through nullptr in debug
If |result_count| is 0 then |results| will be a nullptr and hence the
access |results->Tuple| is undefined behaviour. There's already an
early return in the 0 branch so move that to be the first thing so that
we can guarantee that it's not a nullptr.

Note that technically we take the address of the result so it's not
actually dereferencing it, however UBSan doesn't care about that.
2024-12-01 11:54:51 +11:00