|
2660da6f
|
2023-02-28T17:50:26
|
|
Always allocate zt in output of SDL_iconv_string()
Before this, the function could not be used on buffers,
as it would not account for the zero-termination unless
it was included in the input.
(cherry picked from commit 5f5abb680523e1adedd3fca2a8e252db01fc1c52)
|
|
9dea06f5
|
2023-05-26T23:55:04
|
|
fix mingw build failures in CI with clang-tidy.
(cherry-picked from commit a8a72de6fbcf9afe8a6e8760f31a79a0ed6fed1a)
|
|
707e9397
|
2023-04-30T21:38:29
|
|
Removed memset_pattern4() from SDL headers
This requires including string.h, which isn't always done, so this commit simplifies dependencies on macOS
Fixes https://github.com/libsdl-org/SDL/issues/3657
|
|
00811746
|
2023-03-23T14:04:24
|
|
Fix clang-tidy error on LLVM 16.
Starting LLVM 16, clang-diagnostic-implicit-function-declaration is
treated as an error.
(cherry picked from commit ea093378a29b786edbaa265045638f66d7f83d8b)
|
|
a23d1af0
|
2023-02-10T19:23:59
|
|
Guard against _USE_MATH_DEFINES redefinition
|
|
0479df53
|
2023-01-09T09:48:21
|
|
Updated copyright for 2023
|
|
297ecb70
|
2022-11-05T15:58:30
|
|
Added SDL_strcasestr() for a case insensitive version of SDL_strstr()
|
|
c6e89619
|
2022-10-19T08:05:47
|
|
Define _USE_MATH_DEFINES for Visual Studio (thanks @pionere!)
Fixes https://github.com/libsdl-org/SDL/issues/3790
|
|
65527537
|
2021-03-30T04:32:39
|
|
N3DS port (squashed)
A dedicated renderer using Citro3D would likely allow for better
much better graphical performances.
|
|
f6b81125
|
2022-08-18T16:05:22
|
|
Always define SDL_COMPILE_TIME_ASSERT as static_assert() in C++
Apparently some versions of gcc will define __STDC_VERSION__ even when compiling in C++ mode.
Fixes https://github.com/libsdl-org/SDL/issues/6078
|
|
b4c4dd84
|
2022-08-11T09:52:58
|
|
Added SDL_crc16() to be used in joystick GUIDs after 2.24.0
|
|
cbd01874
|
2022-06-27T16: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-27T17: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-17T10: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-05T02:23:05
|
|
stdlib: Add `SDL_utf8strnlen`
|
|
0cca71a8
|
2022-05-18T22:12:05
|
|
Use SDLCALL for callbacks in public APIs
|
|
8ab3ae98
|
2022-05-10T09: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-09T14: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-25T23:55:50
|
|
add SDL_bsearch
|
|
00feca27
|
2022-04-20T07:51:04
|
|
Add SDL_FLT_EPSILON.
|
|
3425e995
|
2022-03-30T10:12:49
|
|
stdinc: SDL_COMPILE_TIME_ASSERT defines shouldn't have a semicolon.
|
|
f0d2747d
|
2022-03-17T14:56:04
|
|
use _Static_assert for SDL_COMPILE_TIME_ASSERT(), when available
|
|
120c76c8
|
2022-01-03T09:40:00
|
|
Updated copyright for 2022
|
|
3bf7994f
|
2021-09-27T14: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-11T15: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-27T14: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-07T22: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-05T01:17:29
|
|
include: Swap parameter names in atan2 functions
|
|
c7dafb15
|
2021-10-27T01:36:05
|
|
Sync wiki -> header
|
|
1b49f092
|
2021-10-08T20:22:48
|
|
include: manually ran wikiheaders.pl and cleaned up the obvious issues.
|
|
25a614bc
|
2021-09-14T20:37:35
|
|
Add SDL_asprintf and SDL_vasprintf
|
|
72f41d1f
|
2021-08-14T21:11:17
|
|
Added missing parenthesis around SDL_clamp
|
|
35c1bbfa
|
2021-08-13T21: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-13T06: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-10T16:51:03
|
|
Clarified that you should never have side-effects in the parameters to SDL_min/SDL_max
|
|
c88eb7a8
|
2021-07-14T17:07:04
|
|
Sync wiki -> header.
|
|
25fc40b0
|
2021-06-10T13: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-18T16:34:24
|
|
VITASDK compatibility
|
|
a2fbc452
|
2021-02-15T03:02:32
|
|
replace i386 checks with __i386__
|
|
dfe219ec
|
2021-02-13T11: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-11T02: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-02T10:25:38
|
|
Updated copyright for 2021
|
|
93ccdee8
|
2020-12-23T13: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-12T23:28:10
|
|
fix bug #5394 - define _DARWIN_C_SOURCE only if not already defined
|
|
46a84478
|
2020-11-24T12:43:01
|
|
Added SDL_wcscasecmp() and SDL_wcsncasecmp()
|
|
71e32f5e
|
2020-11-16T15:00:15
|
|
Added SDL_crc32()
|
|
79221e85
|
2020-10-29T20: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-28T17: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-10T12:17:14
|
|
stdlib: Add SDL_trunc and SDL_truncf
|
|
aa384ad0
|
2020-03-02T15:21:07
|
|
Fixed bug 5001 - Feature request: SDL_isupper & SDL_islower
|
|
a8780c6a
|
2020-01-16T20:49:25
|
|
Updated copyright date for 2020
|
|
65096446
|
2019-11-20T16:42:50
|
|
Improved XInput VID/PID detection and added SDL_wcsstr() and SDL_wcsncmp()
|
|
eb8f14bb
|
2019-11-20T20:40:50
|
|
added SDL_strtokr() as a replacement for POSIX strtok_r (bug #4046.)
|
|
f49c07b5
|
2019-09-04T00:39:47
|
|
stdinc: On macOS and iOS, use memset_pattern4() for SDL_memset4().
Fixes Bugzilla #4724.
|
|
7a47c292
|
2019-07-31T01:22:02
|
|
Fix bug 4746 - introduce SDL_zeroa macro.
|
|
5e13087b
|
2019-01-04T22:01:14
|
|
Updated copyright for 2019
|
|
d2042e1e
|
2018-08-09T16: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-04T11:52:46
|
|
SDL_exp
|
|
c11ae93a
|
2018-05-10T08:28:00
|
|
SDL_stdinc.h: move the alloca() includes before begin_code.h
|
|
4c2a444e
|
2018-02-08T17:07:47
|
|
add SDL_log10 and SDL_log10f to include and dynapi
|
|
e3cc5b2c
|
2018-01-03T10:03:25
|
|
Updated copyright for 2018
|
|
bcdf8b91
|
2017-11-04T17:35:03
|
|
Added SDL_fmod() and SDL_fmodf()
|
|
34502143
|
2017-11-04T15:34:14
|
|
Added float versions of SDL's math functions
|
|
a225ffc1
|
2017-10-16T14:39:56
|
|
Added min/max macros for the sized SDL datatypes
|
|
fc60db86
|
2017-10-12T17:17:09
|
|
Fixed compiler warning
|
|
9c580e14
|
2017-10-12T13:44:28
|
|
Added functions to query and set the SDL memory allocation functions:
SDL_GetMemoryFunctions()
SDL_SetMemoryFunctions()
SDL_GetNumAllocations()
|
|
4ca5d862
|
2017-09-06T04: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-13T22:26:44
|
|
Added wchar.h to fix build on some platforms with new wcs* functions
|
|
f1829d95
|
2017-08-13T20:37:49
|
|
Added SDL_wcscmp()
|
|
43d62b74
|
2017-06-10T15: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-04T23:15:39
|
|
Fixed comments in headers for doxygen output.
|
|
d4086e4a
|
2017-05-29T03:01:05
|
|
stdlib: added SDL_utf8strlen().
|
|
ca0bf151
|
2017-03-03T16:38:17
|
|
Fix some more compiler warnings on armcc.
|
|
45b774e3
|
2017-01-01T18:33:28
|
|
Updated copyright for 2017
|
|
36156335
|
2016-11-20T21:34:54
|
|
Renaming of guard header names to quiet -Wreserved-id-macro
Patch contributed by Sylvain
|
|
73f2c541
|
2016-10-07T16: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-01T10: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-02T10:10:34
|
|
Updated copyright to 2016
|
|
0e45984f
|
2015-06-21T17: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-26T06:27:46
|
|
Updated the copyright year to 2015
|
|
b72938c8
|
2015-04-20T12: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-10T23:30:31
|
|
Fixed an iOS view orientation issue when SDL_GL_CreateContext or SDL_CreateRenderer is called.
|
|
1339ce71
|
2015-04-08T01:42:47
|
|
Make SDL_stdinc.h work when compiling with -Wundef (thanks, Ben!).
Fixes Bugzilla #2664.
|
|
483ea8b7
|
2015-03-02T21: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-10T16: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-26T22: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-05T01: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-03T12:47:39
|
|
ugh.. stray character
|
|
06d357fb
|
2014-12-03T12:45:04
|
|
fix SDL_PRIs64 on windows compilers.. (should end in d)
|
|
73daadb7
|
2014-12-03T12:23:17
|
|
switch to use SDL_PRI* macros for long long formatting everywhere.
|
|
70438be2
|
2014-12-03T10: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-22T22:20:40
|
|
Corrected header file documentation comment.
|
|
24c86b55
|
2014-09-11T19: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-17T13:11:55
|
|
Removed SDL_round() because the license wasn't compatible with zlib
|
|
4e7db78e
|
2014-08-16T23:23:15
|
|
Added SDL_round(), contributed by Benoit Pierre - thanks!
|
|
3344db40
|
2014-06-23T11:06:50
|
|
Don't redefine standard macros, use SDL specific macros instead to avoid compiler warnings
|
|
ce84813a
|
2014-06-21T11: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-08T12:51:02
|
|
Fixed typo in source comment.
|
|
6101e4b2
|
2014-06-07T18:20:01
|
|
Added SDL_sqrtf(), SDL_tan(), SDL_tanf()
|
|
da6d9a9f
|
2014-06-04T10:56:56
|
|
Added annotations to help code analysis tools
CR: Bruce Dawson
|