35 Commits
Author SHA1 Message Date
Ryan C. Gordon 73fed37c04 assert: make disabled asserts work with bitfield conditions.
We don't care _what_ the `sizeof` results are, we just want it to vaporize
the condition's code out of the build. So we check it with a `? 1 : 0`, so it
always boils down to a `sizeof (int)`, no matter what data type the condition
actually is.

This works with bitfields, pointers, anything that can be "truthy." If it
isn't truthy, it would fail when assertions are enabled anyhow.

Fixes #15990.

(manually cherry picked from commit daf519ae05)
2026-07-13 18:30:53 -04:00
Sam Lantinga f432937f9c Updated copyright for 2026 2026-01-01 09:51:07 -08:00
Ryan C. Gordon 272b073323 SDL_enabled_assert(): Use NULL istead of 0 to explicity initialize the pointer members of SDL_AssertData
(cherry picked from commit faf3bd9991)
2025-08-03 13:40:12 -04:00
Sam Lantinga 2b5b8fdbd5 Updated copyright for 2025 2025-01-01 07:47:53 -08:00
SDL Wiki Bot 143d5d779c Sync SDL2 wiki -> header 2024-06-14 06:11:54 +00:00
Carlo Bramini 2cb1a2d0a7 SDL_assert: add support for aarch64-w64-mingw32
GCC 15 development branch provides an experimental support for Windows on ARM64, which will be officially released next year, according to latest news.
I tried to compile SDL2 with this new compiler but I got a tiny problem into SDL_assert.h because it couldn't find the right platform.
However, it has been easy to fix and I included it into this PR.
More details can be also found here:
https://learn.microsoft.com/en-us/cpp/intrinsics/debugbreak?view=msvc-170
2024-06-03 10:52:11 -07:00
Sam Lantinga 0fc3574464 Updated copyright for 2024 2024-01-01 13:19:49 -08:00
David CARLIER 4a0f56b679 SDL_TriggerBreakppoint for riscv arch (both 32/64) version.
`ebreak` acts like int3 for x86, giving control of running process to debuggers.
(cherry picked from commit 723bcd0a8b)
2023-08-13 23:02:02 +03:00
Ozkan Sezer 22de91a947 Removed guard around the enabled assertions support code
Otherwise, SDL_assert_always() wouldn't work.

Fixes https://github.com/libsdl-org/SDL/issues/7433
2023-03-09 20:51:50 +03:00
Sam Lantinga 0479df53ca Updated copyright for 2023 2023-01-09 09:48:21 -08:00
Anthony Heathcoat 2a25b69ba5 Check if GNC is defined before checking its value to solve warns in msvc 2022-07-03 00:56:09 -07:00
Sam Lantinga e97b506242 Need SDL_stdinc.h for _SDL_HAS_BUILTIN 2022-05-21 10:06:05 -07:00
Sam Lantinga 626a3c5ef7 Use _SDL_HAS_BUILTIN() instead of __has_builtin 2022-05-21 09:58:39 -07:00
David Carlier 1f48f8cd28 SDL_TriggerBreakPoint update using builtin instead of assembly versions if available 2022-05-21 09:50:04 -07:00
pionere 014e2bbdb2 use SDL_COMPILE_TIME_ASSERT instead of SDL_STATIC_ASSERT 2022-01-28 20:40:19 -05:00
pionere 942b01a54c do not use RWOps in WIN_SetWindowIcon 2022-01-28 20:40:19 -05:00
Sam Lantinga 120c76c84b Updated copyright for 2022 2022-01-03 09:40:21 -08:00
SDL Wiki Bot c7dafb1556 Sync wiki -> header 2021-10-27 01:36:05 +00:00
Ryan C. Gordon 7c08b049e8 headers: a few minor documentation corrections. 2021-03-23 15:36:26 -04:00
Ryan C. Gordon 3f40396d33 First shot at merging the wiki documentation into the headers. 2021-03-21 14:19:53 -04:00
Sam Lantinga 69bd7ebbca Fixed build 2021-01-15 00:02:33 -08:00
Sam Lantinga b2aaab3d53 Fixed bug 5462 - debug trap update/fix of assembly for Apple devices
David Carlier

updating preprocessor constant and proposing 32 bits variant.
2021-01-14 14:34:24 -08:00
Sam Lantinga 9130f7c377 Updated copyright for 2021 2021-01-02 10:25:38 -08:00
Ryan C. Gordon af71510cca assert: Implement SDL_TriggerBreakpoint for Apple ARM hardware. 2020-07-16 04:43:08 -04:00
Sam Lantinga a8780c6a28 Updated copyright date for 2020 2020-01-16 20:49:25 -08:00