Commit Graph

6 Commits

Author SHA1 Message Date
Anonymous Maarten
80cf3f7c38 ci: Fix check_stdlib_usage.py and run on ci 2024-09-25 23:59:35 +02:00
Anonymous Maarten
1561d7c089 Fix warnings in build-scripts/check_stdlib_usage.py 2024-09-25 20:34:32 +02:00
Sam Lantinga
6f2621438a Renamed DECLSPEC to SDL_DECLSPEC 2024-05-17 17:09:09 -07:00
Ryan C. Gordon
1e8b006d43 stdlib: qsort and bsearch changes.
- Always use internal qsort and bsearch implementation.
- add "_r" reentrant versions.

The reasons for always using the internal versions is that the C runtime
versions' callbacks are not mark STDCALL, so we would have add bridge
functions for them anyhow, The C runtime qsort_r/qsort_s have different
orders of arguments on different platforms, and most importantly: qsort()
isn't a stable sort, and isn't guaranteed to give the same ordering for
two objects marked as equal by the callback...as such, Visual Studio and
glibc can give different sort results for the same data set...in this
sense, having one piece of code shared on all platforms makes sense here,
for reliabillity.

bsearch does not have a standard _r version at all, and suffers from the
same SDLCALL concern. Since the code is simple and we would have to work
around the C runtime, it's easier to just go with the built-in function
and remove all the CMake C runtime tests.

Fixes #9159.
2024-03-01 08:28:12 -05:00
Sam Lantinga
5b3ee51c6c Updated copyright for 2024 2024-01-01 13:15:26 -08:00
Sam Lantinga
c065a9b128 Fix some issues caught by check_stdlib_usage.py 2023-06-27 06:19:06 -07:00