kc3-lang/SDL/include/SDL_stdinc.h

Branch :


Log

Author Commit Date CI Message
cbd01874 2022-06-27 16:59:50 Removed the limit on the size of the SDL error message Also added SDL_GetOriginalMemoryFunctions() Fixes https://github.com/libsdl-org/SDL/issues/5795
3b191580 2022-06-27 17:19:39 Windows GDK Support (#5830) * Added GDK * Simplfied checks in SDL_config_wingdk.h * Added testgdk sample * Added GDK readme * Fixed error in merge of SDL_windows.h * Additional GDK fixes * OpenWatcom should not export _SDL_GDKGetTaskQueue * Formatting fixes * Moved initialization code into SDL_GDKRunApp
adc68758 2022-06-17 10:22:28 Added SDL_copyp to avoid size mismatch when copying values (thanks @1bsyl!) Closes https://github.com/libsdl-org/SDL/pull/5811
74bcc5a0 2022-05-05 02:23:05 stdlib: Add `SDL_utf8strnlen`
0cca71a8 2022-05-18 22:12:05 Use SDLCALL for callbacks in public APIs
8ab3ae98 2022-05-10 09:44:23 stdinc: Add a comment to clarify why inline functions are needed here Signed-off-by: Simon McVittie <smcv@collabora.com>
f661654f 2022-05-09 14:36:27 stdinc: Add overflow-checking add and multiply for size_t This can be used to check whether untrusted sizes would cause overflow when used to calculate how much memory is needed. Signed-off-by: Simon McVittie <smcv@collabora.com>
e9ff4fdd 2022-04-25 23:55:50 add SDL_bsearch
00feca27 2022-04-20 07:51:04 Add SDL_FLT_EPSILON.
3425e995 2022-03-30 10:12:49 stdinc: SDL_COMPILE_TIME_ASSERT defines shouldn't have a semicolon.
f0d2747d 2022-03-17 14:56:04 use _Static_assert for SDL_COMPILE_TIME_ASSERT(), when available
120c76c8 2022-01-03 09:40:00 Updated copyright for 2022
3bf7994f 2021-09-27 14:38:12 Add and use `SDL_FALLTHROUGH` for fallthroughs Case fallthrough warnings can be suppressed using the __fallthrough__ compiler attribute. Unfortunately, not all compilers have this attribute, or even have __has_attribute to check if they have the __fallthrough__ attribute. [[fallthrough]] is also available in C++17 and the next C2x, but not everyone uses C++17 or C2x. So define the SDL_FALLTHROUGH macro to deal with those problems - if we are using C++17 or C2x, it expands to [[fallthrough]]; else if the compiler has __has_attribute and has the __fallthrough__ attribute, then it expands to __attribute__((__fallthrough__)); else it expands to an empty statement, with a /* fallthrough */ comment (it's a do {} while (0) statement, because users of this macro need to use a semicolon, because [[fallthrough]] and __attribute__((__fallthrough__)) require a semicolon). Clang before Clang 10 and GCC before GCC 7 have problems with using __attribute__ as a sole statement and warn about a "declaration not declaring anything", so fall back to using the /* fallthrough */ comment if we are using those older compiler versions. Applications using SDL are also free to use this macro (because it is defined in begin_code.h). All existing /* fallthrough */ comments have been replaced with this macro. Some of them were unnecessary because they were the last case in a switch; using SDL_FALLTHROUGH in those cases would result in a compile error on compilers that support __fallthrough__, for having a __attribute__((__fallthrough__)) statement that didn't immediately precede a case label.
abc12a83 2021-11-11 15:58:44 Revert "Add and use `SDL_FALLTHROUGH` for fallthroughs" This reverts commit 66a08aa3914a98667f212e79b4f0b9453203d656. This causes problems with older compilers: https://github.com/libsdl-org/SDL/pull/4791#issuecomment-966630997
66a08aa3 2021-09-27 14:38:12 Add and use `SDL_FALLTHROUGH` for fallthroughs Case fallthrough warnings can be suppressed using the __fallthrough__ compiler attribute. Unfortunately, not all compilers have this attribute, or even have __has_attribute to check if they have the __fallthrough__ attribute. [[fallthrough]] is also available in C++17 and the next C2x, but not everyone uses C++17 or C2x. So define the SDL_FALLTHROUGH macro to deal with those problems - if we are using C++17 or C2x, it expands to [[fallthrough]]; else if the compiler has __has_attribute and has the __fallthrough__ attribute, then it expands to __attribute__((__fallthrough__)); else it expands to an empty statement, with a /* fallthrough */ comment (it's a do {} while (0) statement, because users of this macro need to use a semicolon, because [[fallthrough]] and __attribute__((__fallthrough__)) require a semicolon). Applications using SDL are also free to use this macro (because it is defined in begin_code.h). All existing /* fallthrough */ comments have been replaced with this macro. Some of them were unnecessary because they were the last case in a switch; using SDL_FALLTHROUGH in those cases would result in a compile error on compilers that support __fallthrough__, for having a __attribute__((__fallthrough__)) statement that didn't immediately precede a case label.
5b646cd1 2021-11-07 22:58:44 Build hidapi code into SDL as a new public API This prevents conflicts with hidapi linked with applications, as well as allowing applications to make use of HIDAPI on Android and other platforms that might not normally have an implementation available.
6cbee063 2021-11-05 01:17:29 include: Swap parameter names in atan2 functions
c7dafb15 2021-10-27 01:36:05 Sync wiki -> header
1b49f092 2021-10-08 20:22:48 include: manually ran wikiheaders.pl and cleaned up the obvious issues.
25a614bc 2021-09-14 20:37:35 Add SDL_asprintf and SDL_vasprintf
72f41d1f 2021-08-14 21:11:17 Added missing parenthesis around SDL_clamp
35c1bbfa 2021-08-13 21:43:00 SDL_stdinc.h: Add an SDL_clamp() function Add a function to clamp a value to a range. SDL_clamp(x, a, b) is equivalent to SDL_min(a, SDL_max(x, b)): it ensures that x is not smaller than a, nor larger than b. While, as best I can tell, this isn't actually standardised anywhere, it's a very useful function/macro to have.
9bf65575 2021-08-13 06:36:49 Correctly check for bswap builtins before using The __clang_major__ and __clang_minor__ macros provide a marketing version, which is not necessarily comparable for clang distributions from different vendors[1]. In practice, the versioning scheme for Apple's clang is indeed completely different to that of the llvm.org releases. It is thus preferable to check for features directly rather than comparing versions. In this specific case, __builtin_bswap16 was being used with older Apple clang versions that don't support it. [1] https://clang.llvm.org/docs/LanguageExtensions.html#builtin-macros
d5ad6f6e 2021-08-10 16:51:03 Clarified that you should never have side-effects in the parameters to SDL_min/SDL_max
c88eb7a8 2021-07-14 17:07:04 Sync wiki -> header.
25fc40b0 2021-06-10 13:56:22 stdinc: Silence clang warning for -Wimplicit-fallthrough. In a more ideal world, we'd use the appropriate `__attribute__` here, but it's one thing in a public header that probably shouldn't be there at all, so this is good enough for now. Fixes #4307.
ca5e5d61 2020-12-18 16:34:24 VITASDK compatibility
a2fbc452 2021-02-15 03:02:32 replace i386 checks with __i386__
dfe219ec 2021-02-13 11:21:19 Add all missing "is characteristic" stdlib functions SDL has been missing a bunch of these 'isX' functions for some time, where X is some characteristic of a given character. This commit adds the rest of them to the SDL stdlib, so now we have: - SDL_isalpha() - SDL_isalnum() - SDL_isblank() - SDL_iscntrl() - SDL_isxdigit() - SDL_ispunct() - SDL_isprint() - SDL_isgraph()
f443a6fc 2021-02-11 02:05:02 Fix format string warnings for width-based integers The DJGPP compiler emits many warnings for conflicts between print format specifiers and argument types. To fix the warnings, I added `SDL_PRIx32` macros for use with `Sint32` and `Uint32` types. The macros alias those found in <inttypes.h> or fallback to a reasonable default. As an alternative, print arguments could be cast to plain old integers. I opted slightly for the current solution as it felt more technically correct, despite making the format strings more verbose.
9130f7c3 2021-01-02 10:25:38 Updated copyright for 2021
93ccdee8 2020-12-23 13:47:49 Fixed bug 5404 - stdlib: Added SDL_round, SDL_roundf, SDL_lround and SDL_lroundf Cameron Cawley stdlib: Added SDL_round, SDL_roundf, SDL_lround and SDL_lroundf The default implementation is based on the one used in the Windows RT video driver.
bca9decb 2020-12-12 23:28:10 fix bug #5394 - define _DARWIN_C_SOURCE only if not already defined
46a84478 2020-11-24 12:43:01 Added SDL_wcscasecmp() and SDL_wcsncasecmp()
71e32f5e 2020-11-16 15:00:15 Added SDL_crc32()
79221e85 2020-10-29 20:00:20 SDL_stdinc.h: define _DARWIN_C_SOURCE on macOS for memset_pattern4() hopefully fixes https://bugzilla.libsdl.org/show_bug.cgi?id=5107
6aec6da4 2020-06-28 17:45:07 stdinc: Let Clang static analysis see more C runtime functions. For systems without strlcpy and strlcat, just declare them as if they exist; the analyzer possibly still knows the details of these functions and can utilize that in its analysis. Most of this patch was from meyraud705 at gmail and Martin Gerhardy. Thanks! Fixes Bugzilla #5163.
d292f6bd 2020-04-10 12:17:14 stdlib: Add SDL_trunc and SDL_truncf
aa384ad0 2020-03-02 15:21:07 Fixed bug 5001 - Feature request: SDL_isupper & SDL_islower
a8780c6a 2020-01-16 20:49:25 Updated copyright date for 2020
65096446 2019-11-20 16:42:50 Improved XInput VID/PID detection and added SDL_wcsstr() and SDL_wcsncmp()
eb8f14bb 2019-11-20 20:40:50 added SDL_strtokr() as a replacement for POSIX strtok_r (bug #4046.)
f49c07b5 2019-09-04 00:39:47 stdinc: On macOS and iOS, use memset_pattern4() for SDL_memset4(). Fixes Bugzilla #4724.
7a47c292 2019-07-31 01:22:02 Fix bug 4746 - introduce SDL_zeroa macro.
5e13087b 2019-01-04 22:01:14 Updated copyright for 2019
d2042e1e 2018-08-09 16:00:17 Added HIDAPI joystick drivers for more consistent support for Xbox, PS4 and Nintendo Switch Pro controller support across platforms. Added SDL_GameControllerRumble() and SDL_JoystickRumble() for simple force feedback outside of the SDL haptics API
b4fe7412 2018-08-04 11:52:46 SDL_exp
c11ae93a 2018-05-10 08:28:00 SDL_stdinc.h: move the alloca() includes before begin_code.h
4c2a444e 2018-02-08 17:07:47 add SDL_log10 and SDL_log10f to include and dynapi
e3cc5b2c 2018-01-03 10:03:25 Updated copyright for 2018
bcdf8b91 2017-11-04 17:35:03 Added SDL_fmod() and SDL_fmodf()
34502143 2017-11-04 15:34:14 Added float versions of SDL's math functions
a225ffc1 2017-10-16 14:39:56 Added min/max macros for the sized SDL datatypes
fc60db86 2017-10-12 17:17:09 Fixed compiler warning
9c580e14 2017-10-12 13:44:28 Added functions to query and set the SDL memory allocation functions: SDL_GetMemoryFunctions() SDL_SetMemoryFunctions() SDL_GetNumAllocations()
4ca5d862 2017-09-06 04:32:30 Fixed bug 3780 - GCC 7 implicit fallthrough warnings Martin Gerhardy 2017-08-28 06:58:01 UTC SDL_blit.h, SDL_fillrect.c and SDL_stdinc.h produces a lot of the (new) gcc-7 implicit fallthrough warnings.
f8de064c 2017-08-13 22:26:44 Added wchar.h to fix build on some platforms with new wcs* functions
f1829d95 2017-08-13 20:37:49 Added SDL_wcscmp()
43d62b74 2017-06-10 15:38:14 Make compile-time assert error messages more clear. Now the compiler might say this: 'SDL_compile_time_assert_mytest' declared as an array with a negative size instead of 'SDL_dummy_mytest' declared as an array with a negative size
cbcc256f 2017-06-04 23:15:39 Fixed comments in headers for doxygen output.
d4086e4a 2017-05-29 03:01:05 stdlib: added SDL_utf8strlen().
ca0bf151 2017-03-03 16:38:17 Fix some more compiler warnings on armcc.
45b774e3 2017-01-01 18:33:28 Updated copyright for 2017
36156335 2016-11-20 21:34:54 Renaming of guard header names to quiet -Wreserved-id-macro Patch contributed by Sylvain
73f2c541 2016-10-07 16:44:42 Fixed bug 2885 - SDL_stdinc.h doesn't need to include iconv.h Ryan C. Gordon We still include iconv.h in SDL_stdinc.h, probably because this header might have referenced the native iconv functions and types directly. Since these are hidden behind a stable ABI now and never just a #define for the system iconv, we shouldn't need this header included from a public SDL header anymore, slowing down external apps compiles and pulling tons of stuff into the namespace.
b7e45f8a 2016-10-01 10:28:00 Fixed bug 3336 - Failure to build with MinGW-w64 Kai Sterker There are already patches available from mingw64 that fix the issue https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-SDL2 With those applied, I could compile SDL2 without problems. But of course, it would be preferable if SDL built cleanly from source.
42065e78 2016-01-02 10:10:34 Updated copyright to 2016
0e45984f 2015-06-21 17:33:46 Fixed crash if initialization of EGL failed but was tried again later. The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly uninitialized data structure if loading the library first failed. A later try to use EGL then skipped initialization and assumed it was previously successful because the data structure now already existed. This led to at least one crash in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was dereferenced to make a call to eglBindAPI().
2c4a6ea0 2015-05-26 06:27:46 Updated the copyright year to 2015
b72938c8 2015-04-20 12:22:44 Windows: Always set the system timer resolution to 1ms by default. An existing hint lets apps that don't need the timer resolution changed avoid this, to save battery, etc, but this fixes several problems in timing, audio callbacks not firing fast enough, etc. Fixes Bugzilla #2944.
fe6c797c 2015-04-10 23:30:31 Fixed an iOS view orientation issue when SDL_GL_CreateContext or SDL_CreateRenderer is called.
1339ce71 2015-04-08 01:42:47 Make SDL_stdinc.h work when compiling with -Wundef (thanks, Ben!). Fixes Bugzilla #2664.
483ea8b7 2015-03-02 21:36:45 Fixed SDL_PRI?64 for 64-bit Linux. 64-bit Linux uses a "long" instead of "long long" for 64-bit ints. Added a special-case this so SDL_PRI?64 doesn't trigger compiler warnings when used with SDL's 64-bit datatypes on 64-bit Linux.
b88ca1b4 2015-02-10 16:28:56 the last parameter of XChangeProperty is the number of elements.. and when the element format is 32.. the element is "long" so we have 5 long elements here. Yes this seems confusing as on mac+linux Long is either 32 or 64bits depending on the architecture, but this is how the X11 protocol is defined. Thus 5 is the correct value for the nelts here. Not 5 or 10 depending on the architecture. More info on the confusion https://bugs.freedesktop.org/show_bug.cgi?id=16802
b48e54aa 2015-01-26 22:00:29 Fixed bug 2802 - [patch] Fix android build compiling in wrong filesystem implementation Jonas Kulla The configure script didn't differentiate between Linux and Android, unconditionally compiling in the unix implementation of SDL_sysfilesystem.c. I'm probably one of the very few people building SDL for android using classic configure + standalone toolchain, so this has gone undetected all along.
a823982e 2015-01-05 01:41:42 Clang static analysis builds should use C runtime directly. This is a little macro magic to use malloc() directly instead of SDL_malloc(), etc, so static analysis tests that know about the C runtime can function properly, and understand that we are dealing with heap allocations, etc. This changed our static analysis report from 5 outstanding bugs to 30. 5x as many bugs were hidden by SDL_malloc() not being recognized as malloc() by the static analyzer!
623b9d6d 2014-12-03 12:47:39 ugh.. stray character
06d357fb 2014-12-03 12:45:04 fix SDL_PRIs64 on windows compilers.. (should end in d)
73daadb7 2014-12-03 12:23:17 switch to use SDL_PRI* macros for long long formatting everywhere.
70438be2 2014-12-03 10:55:23 WinRT: fixed bug whereby SDL would override an app's default orientation WinRT apps can set a default, preferred orientation via a .appxmanifest file. SDL was overriding this on app startup, and making the app use all possible orientations (landscape and portrait). Thanks to Eric Wing for the heads up on this!
9c398852 2014-11-22 22:20:40 Corrected header file documentation comment.
24c86b55 2014-09-11 19:24:42 [X11] Reconcile logical keyboard state with physical state on FocusIn since the window system doesn't do it for us like other platforms. This prevents sticky keys and missed keys when going in and out of focus, for example Alt would appear to stick if switching away from an SDL app with Alt-Tab and had to be pressed again. CR: Sam
1ea86978 2014-08-17 13:11:55 Removed SDL_round() because the license wasn't compatible with zlib
4e7db78e 2014-08-16 23:23:15 Added SDL_round(), contributed by Benoit Pierre - thanks!
3344db40 2014-06-23 11:06:50 Don't redefine standard macros, use SDL specific macros instead to avoid compiler warnings
ce84813a 2014-06-21 11:24:06 commit 9e211e646f9d51dc1372c9f3c8f47a78caf4f2a5 Author: Sam Clegg <sbc@chromium.org> Date: Fri Jun 20 12:52:11 2014 Fix win32 build which was failing due to missing PRIs64. This change adds definitions for the C99 PRIs16 and PRIu64 which are missing from <stdint.h> on at last win32 and possibly other platforms. These already existed in testgesture.c so I removed them from there also.
0ad1dc18 2014-06-08 12:51:02 Fixed typo in source comment.
6101e4b2 2014-06-07 18:20:01 Added SDL_sqrtf(), SDL_tan(), SDL_tanf()
da6d9a9f 2014-06-04 10:56:56 Added annotations to help code analysis tools CR: Bruce Dawson
3dcb451f 2014-04-09 21:29:19 Added a README file regarding WinRT support To note, this file is currently formatted with CRLF line endings, rather than LF, to allow the file to be viewed with Notepad.
1367bf87 2014-03-09 11:36:47 Integrated David Ludwig's support for Windows RT
58edac3e 2014-02-02 00:53:27 Fixed bug 2374 - Update copyright for 2014... Is it that time already??
f848adff 2013-11-29 10:06:08 Improve Android pause/resume behavior.
46740a5a 2013-11-28 22:09:21 WinRT: merged with latest SDL 2.x/HG code SDL 2.x recently accepted patches to enable OpenGL ES 2 support via Google's ANGLE library. The thought is to try to eventually merge SDL/WinRT's OpenGL code with SDL-official's.
e7693740 2013-11-24 23:35:38 Added SDL_vsscanf().
e4146267 2013-11-16 18:56:02 Fixed bug 2245 - add SDL_acos and SDL_asin Sylvain Here's some code to add arc cosine, and arc sin functions to SDL_stdlib.c There are plainly written using SDL_atan.
2efd4065 2013-11-03 09:42:23 Clarified that SDL_memset4 is a 32-bit assignment and fixed a compiler warning
69c5d21d 2013-10-27 21:26:46 WinRT: merged with SDL 2.0.1 codebase
1e78c4a5 2013-08-27 12:20:35 WinRT: more "Windows RT" to "WinRT" renaming
1e49b1ed 2013-08-21 09:47:10 OCD fixes: Adds a space after /* (glory to regular expressions!)