Commit graph

164 commits

Author SHA1 Message Date
Sam Lantinga
ab832f1be0 Added documentation for qsort and bsearch functions 2024-09-30 11:18:17 -07:00
Sam Lantinga
a923771978 Added SDL_murmur3_32() 2024-09-28 17:19:01 -07:00
Sam Lantinga
039148fb0e Updated check for stdbool.h
If you're building in a C99 or newer environment, we'll automatically include stdbool.h.

If you're building in a C89 or C90 environment, we'll assume that stdbool.h isn't available and define bool as an unsigned char. If you have a working stdbool.h and want SDL to use it, you can either include stdbool.h before SDL headers, or define SDL_INCLUDE_STDBOOL_H in your project.

Closes https://github.com/libsdl-org/SDL/pull/10980
2024-09-28 16:55:09 -07:00
Sam Lantinga
3f446d8fb5 Minor cleanup 2024-09-27 14:10:46 -07:00
Sam Lantinga
b0e528cc88 Switched ifdef from negative to positive 2024-09-21 20:12:54 -07:00
Ozkan Sezer
254b36361e Add SDL_PRILL? format specifiers specifically for long long type. 2024-09-21 23:03:50 +03:00
Ozkan Sezer
7edf7fad66 fix bool define when SDL_DEFINE_STDBOOL is defined:
it should be unsigned.
2024-09-18 12:17:22 -07:00
Ozkan Sezer
ff90570a3c define SDL_DEFINE_STDBOOL for gcc < 3 2024-09-18 12:17:22 -07:00
Sam Lantinga
ea640894d3 Fixed SDL_DEFINE_STDBOOL logic if __bool_true_false_are_defined is defined 2024-09-18 10:50:52 -07:00
Sam Lantinga
32fd1878a0 Provide a definition of bool if needed for your environment 2024-09-18 10:37:11 -07:00
SDL Wiki Bot
026d3c2306 Sync SDL3 wiki -> header 2024-09-18 15:33:11 +00:00
Sam Lantinga
a90ad3b0e2 Removed SDL_bool in favor of plain bool
We require stdbool.h in the build environment, so we might as well use the plain bool type.

If your environment doesn't have stdbool.h, this simple replacement will suffice:
typedef signed char bool;
2024-09-18 08:32:30 -07:00
Sam Lantinga
97d40b9218 Removed SDL_CleanupEnvironment() 2024-09-15 10:00:21 -07:00
SDL Wiki Bot
a7f1deae8d Sync SDL3 wiki -> header 2024-09-15 16:38:38 +00:00
Sam Lantinga
28b94c4758 Re-added SDL_getenv() as a thread-safe getenv() implementation 2024-09-15 09:37:04 -07:00
Sam Lantinga
8569bde053 Fixed typo 2024-09-14 14:35:57 -07:00
SDL Wiki Bot
706aaaf280 Sync SDL3 wiki -> header 2024-09-14 20:23:16 +00:00
Ryan C. Gordon
3bc0347761
Revert "Sync SDL3 wiki -> header"
This reverts commit 35427ff9ec.
2024-09-14 16:22:16 -04:00
Ryan C. Gordon
c2e4b14a82
Revert "stdinc: Added missing \param to SDL_CreateEnvironment."
This reverts commit 919f8d3e2b.
2024-09-14 16:22:09 -04:00
Ryan C. Gordon
11c9975caa
Revert "Sync SDL3 wiki -> header"
This reverts commit ba65767afa.
2024-09-14 16:22:00 -04:00
SDL Wiki Bot
ba65767afa Sync SDL3 wiki -> header 2024-09-14 20:18:20 +00:00
Ryan C. Gordon
919f8d3e2b
stdinc: Added missing \param to SDL_CreateEnvironment. 2024-09-14 16:17:29 -04:00
SDL Wiki Bot
35427ff9ec Sync SDL3 wiki -> header 2024-09-14 20:11:24 +00:00
Sam Lantinga
aa7357a14d SDL_CreateEnvironment() fills the environment with a non-zero parameter 2024-09-14 10:29:02 -07:00
Sam Lantinga
90e01040c5 Added thread-safe environment functions
Also marked the existing functions as unsafe, as they can cause crashes if used in multi-threaded applications.

As a bonus, since the new functions are hashtable based, hint environment lookups are much faster.
2024-09-13 22:14:54 -07:00
SDL Wiki Bot
d483886ec5 Sync SDL3 wiki -> header 2024-09-13 19:32:14 +00:00
Carl Åstholm
7d94bf528d stdlib: Document SDL_strtox functions 2024-09-13 12:30:58 -07:00
Carl Åstholm
fb82772fb3 stdlib: Rewrite SDL_strtoull impl 2024-09-13 12:30:58 -07:00
Carl Åstholm
4efbe1ca28 stdlib: Assert that signed integers use two's complement arithmetic 2024-09-13 12:30:58 -07:00
Carl Åstholm
fd53b3e112 stdlib: Rewrite SDL_wcstol impl
SDL_wcstol should now fully adhere to the libc spec.
2024-09-13 12:30:58 -07:00
Sam Lantinga
4eb4370500 SDL_strtoll(), SDL_strtoull(), SDL_lltoa(), and SDL_ulltoa() use long long values 2024-09-09 15:46:26 -07:00
SDL Wiki Bot
7d1bbae6b2 Sync SDL3 wiki -> header 2024-09-09 20:51:57 +00:00
Carl Åstholm
af37056c0d stdinc: Fix typos and reword comments about aliasing 2024-09-09 13:51:16 -07:00
Carl Åstholm
8eb194b6f8 stdinc: Document number parsing APIs 2024-09-09 13:51:16 -07:00
Carl Åstholm
eda459ac49 stdinc: Fix up some printf definitions 2024-09-09 13:51:16 -07:00
Carl Åstholm
d6caf2abe7 Remove SDL_RESTRICT in favor of doc comments 2024-09-09 13:51:16 -07:00
Carl Åstholm
731939fca1 stdinc: Document memcpy APIs 2024-09-09 13:51:16 -07:00
Carl Åstholm
8cea4bd3c9 stdinc: Document memory allocation APIs 2024-09-09 13:51:16 -07:00
SDL Wiki Bot
6e885d9619 Sync SDL3 wiki -> header 2024-09-09 06:56:45 +00:00
SDL Wiki Bot
301f3ffa9d Sync SDL3 wiki -> header 2024-09-09 06:50:28 +00:00
Ryan C. Gordon
050aa4d084
include: Filling in more documentation gaps. 2024-09-09 02:49:43 -04:00
Ryan C. Gordon
845855d657
Revert "stdinc: Document more symbols."
This reverts commit c93f76436f.

This looked better with the #defines attached to the typedef symbols.
2024-09-06 15:33:27 -04:00
Ryan C. Gordon
c93f76436f
stdinc: Document more symbols. 2024-09-06 15:30:56 -04:00
Ryan C. Gordon
ac08dde1b2 windows: Clean out things that should be using defined(SDL_PLATFORM_WINDOWS). 2024-09-06 13:28:39 -04:00
SDL Wiki Bot
e7969553f8 Sync SDL3 wiki -> header 2024-09-06 02:17:29 +00:00
Sam Lantinga
702ed83f72 Initialize interface structures so they can be extended in the future
We guarantee that we will only add to the end of these interfaces, and any new fields will be optional.
2024-09-05 19:16:00 -07:00
SDL Wiki Bot
741c04b339 Sync SDL3 wiki -> header 2024-09-05 23:36:17 +00:00
Anonymous Maarten
baa1a5e2f4 Add SDL_strpbrk 2024-09-06 01:35:43 +02:00
Sam Lantinga
04a732881a Add a test to verify structure alignment 2024-09-05 15:27:56 -07:00
SDL Wiki Bot
19fb43b94f Sync SDL3 wiki -> header 2024-09-03 00:19:03 +00:00