Commit Graph

10199 Commits (dc2ef31c29e7235369e0468bcbc9af15d7ff50b8)

Author SHA1 Message Date
Zack Middleton 1cd3e83756 cocoa: Fix abort on touch event types without a subtype
macOS 10.6 has some touch NSEvents which do not have a subtype
(Begin/EndGesture, Magnify, Rotate, Swipe) and cause an uncaught
exception which triggers SIGABRT and the program exits.

As it is, none of the macOS 10.6 touch events are detected as a
trackpad (including Gesture due to using different subtypes).
2021-11-14 15:21:51 -08:00
Ozkan Sezer 781caec2b2 SDL_waylandevents.c (keyboard_handle_keymap): silenced -Wwrite-strings . 2021-11-15 00:55:24 +03:00
Ozkan Sezer 5c067906ba wasapi: AvSetMmThreadCharacteristicsW takes an LPCWSTR param, not LPWSTR 2021-11-15 00:55:04 +03:00
Ozkan Sezer 3eb9bfac7a win32 rawinput & wgi joystick: avoid -Werror=declaration-after-statement 2021-11-14 22:22:50 +03:00
Ryan C. Gordon 73a41f4058
Removed outdated build-scripts/iosbuild.sh
Fixes #1532.
2021-11-14 14:17:36 -05:00
Sam Lantinga c55ab9631f Added a hint for alternate OpenGL NV12 data format 2021-11-13 22:21:57 -08:00
Ozkan Sezer 8a6e48d46d constified SDL_RegisterApp() 2021-11-14 04:40:50 +03:00
Ozkan Sezer 7dfd22ac5e fix XGetDefault signature - its first and second params are _Xconst 2021-11-14 02:32:00 +03:00
Ozkan Sezer c7aa04d03e SDL_test_harness.c: avoid -Wwrite-strings 2021-11-14 02:31:20 +03:00
Ozkan Sezer be7b663c2c audio/winmm/SDL_winmm.c (SetMMerror): constify. 2021-11-14 02:30:56 +03:00
Ozkan Sezer e4aa608a5c change (char*) casts to (const char*) in WIN_UTF8 macros 2021-11-14 02:30:34 +03:00
Ozkan Sezer 780f6cbd38 build libSDL2_test too with Makefile.minimal 2021-11-14 01:10:32 +03:00
Cameron Gutman eb98ff4740 testmessage: Fix overread of stack variable 2021-11-13 13:05:02 -06:00
Ozkan Sezer fbe810070b more fixes to standalone makefiles. 2021-11-13 21:56:20 +03:00
Ozkan Sezer 62b41f61d4 fix build of testmouse.c 2021-11-13 21:29:50 +03:00
Ozkan Sezer 2d1706069a fixes to Makefile.minimal 2021-11-13 21:29:32 +03:00
Ozkan Sezer d1e6bd93d8 fix library name in Makefile.pandora 2021-11-13 21:29:10 +03:00
Cameron Gutman 674f361dec wayland: Fix memory leaks in clipboard code 2021-11-13 11:44:36 -06:00
Ozkan Sezer 3e2f8668be added some more missing sources to standalone makefiles. 2021-11-13 20:35:24 +03:00
Cameron Gutman c8061ed2d1 alsa: Fix possible uninitialized string 2021-11-13 10:33:37 -06:00
Ozkan Sezer a2c27d39cf SDL_hidapi_switch.c (ConstructSubcommand): lose use of '&' on rumbleData
SwitchCommonOutputPacket_t->rumbleData is an array.
2021-11-13 17:56:28 +03:00
Ozkan Sezer 6ad0fb8462 SDL_hidapi_ps4.c, SDL_hidapi_ps5.c: use SDL_zeroa() 2021-11-13 17:55:10 +03:00
Sylvain 70c8d20a46
Revert previous commit a50ca98e2b (see bug #4625) 2021-11-13 15:04:19 +01:00
Sylvain a50ca98e2b
Fixed bug #4625 - SDL_RenderSetLogicalSize issues
viewport becomes -2147483648x-2147483648 when logical_w/h is greater than window size.
division should be done with floats
2021-11-13 14:48:36 +01:00
Ozkan Sezer a948ff8494 SDL_hidapijoystick.c: worked around a bogus 'unreachable code' warning. 2021-11-13 11:50:02 +03:00
Cameron Gutman eb3f1462b8 x11: Fix memory leak in X11_CreatePixmapCursor() 2021-11-12 18:26:26 -06:00
Cameron Gutman f124259e59 testautomation: fix use-after-free when restoring hint value 2021-11-12 17:25:24 -06:00
Cameron Gutman 704edf6323 audio: Fix crash calling SDL_OpenAudio() after SDL_AudioInit() fails
The SDL_WasInit() checks don't work when using SDL_AudioInit() directly,
which is exactly what audio_initOpenCloseQuitAudio() in testautomation
does.
2021-11-12 17:07:22 -06:00
Cameron Gutman 78013aeef9 alsa: Fix use-after-free when reinitializing 2021-11-12 16:57:24 -06:00
Ozkan Sezer e688a95ba4 updated os2 makefile for tests 2021-11-12 23:55:40 +03:00
Ozkan Sezer 2cf9374270 minor update to docs/README.md 2021-11-12 20:55:02 +03:00
Ozkan Sezer 3dc7813ae4 more whitespace tidy-ups in SDL_os2messagebox.c 2021-11-12 20:47:02 +03:00
Sam Lantinga c2dd50a9a0 Fixed whitespace 2021-11-12 08:28:02 -08:00
Ozkan Sezer 4a1524350c updated linux dependencies for libXfixes-devel. 2021-11-12 15:55:50 +03:00
Sam Lantinga 074e613bbb Fixed typo 2021-11-12 03:04:11 -08:00
Sam Lantinga 35d90f17e1 Better implementation of SDL_SetWindowMouseGrab() and SDL_SetWindowMouseRect() on macOS 2021-11-12 03:04:11 -08:00
Ozkan Sezer fa3330baec autotools, cmake: test Xfixes along with XInput2.h:
because we use Xfixes with XIBarrierReleasePointer
2021-11-12 12:55:50 +03:00
Ozkan Sezer c3a4a6a033 mark Android.mk as non-executable 2021-11-12 12:55:28 +03:00
Mathieu Eyraud 5fc7a90a8b Fix refcounting in SDL_hid_exit 2021-11-12 01:25:15 -08:00
Sam Lantinga 97c71371f2 If Android version >= API 31 PendingIntent.FLAG_MUTABLE
"If your app targets Android 12, you must specify the mutability of each PendingIntent object that your app creates. This additional requirement improves your app's security."

Thanks @FormularSumo and @cgutman
2021-11-12 01:21:29 -08:00
Sam Lantinga 162772aa63 Fixed build warnings on Android 2021-11-11 20:50:54 -08:00
Sam Lantinga 544d2e6aa0 Don't try to load hidapi at startup on Android 2021-11-11 20:47:19 -08:00
Ozkan Sezer 33735d5997 mark Android.mk as non-executable 2021-11-12 07:40:00 +03:00
Cameron Gutman 50971577e4 dinput: Fix memory leak when SDL_DINPUT_JoystickPresent() returns true 2021-11-11 22:35:41 -06:00
Sam Lantinga ed05a0e9e7 Fixed exception trying to get USB permission
You can't set the intent to be immutable, otherwise the USB system can't set the device and permission in the response. This works fine on Android 12 without an immutable intent.
2021-11-11 20:33:02 -08:00
Ozkan Sezer acb602d607 minor style adjustment 2021-11-12 07:28:00 +03:00
Misa 3bf7994fe2 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.
2021-11-12 07:26:14 +03:00
Sam Lantinga c877dd93c5 The hidapi code is now built into SDL, we don't need to load a shared library for it 2021-11-11 19:29:42 -08:00
Sam Lantinga 9c3bcf8e8a Added SDL_hid_ble_scan() for pairing Steam Controllers on iOS and tvOS 2021-11-11 17:31:14 -08:00
Sam Lantinga abc12a832c Revert "Add and use `SDL_FALLTHROUGH` for fallthroughs"
This reverts commit 66a08aa391.

This causes problems with older compilers:
https://github.com/libsdl-org/SDL/pull/4791#issuecomment-966630997
2021-11-11 15:58:44 -08:00