- use _Interlocked(Compare)ExchangePointer in case of _M_IX86 as well
- improve assertions:
1. add assertions to SDL_AtomicAdd/SDL_AtomicSet and SDL_AtomicCAS
2. use sizeof(a->value) instead of sizeof(int)
Sending rumble to the Amazon Luna controller on macOS gets there, but IOHIDDeviceSetReport() blocks for a long time and eventually fails.
This appears to be a bug in the macOS Bluetooth stack, ref rdar://99265496
- SDL_EventQ.active is a bool variable -> do not use SDL_AtomicGet/Set, it does not help in any way
- protect SDL_EventQ.active with SDL_EventQ.lock
- set SDL_EventQ.active to FALSE by default
This is a USB adapter for controllers shipped with Nintendo's NES-mini and
SNES-mini consoles.
Tested with both NES and SNES controllers, buttons map as expected on both.
Most of this code is disabled out for now.
- For mouse cursors we have a wl_surface for both system and custom
cursors which needs recreating.
- The other patch is about nullification after deletions
This works around udev event nodes arriving before hidraw nodes and the controller being opened twice - once using the Linux driver and once by the HIDAPI driver.
This also fixes a kernel panic on Steam Link hardware due to trying to open the hidraw device node too early.
A delay of 10 ms seems to be a good value, tested on Steam Link hardware.
When SDL is included as a subproject, the following error might appear:
```
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_OBJC_COMPILE_OBJECT
```
This is probably because the master project does not see certain OBJC related variables
If relative mouse mode is explicitly enabled, don't modify the capture flag on button events or the window might report having lost mouse focus if a button is pressed while moving the cursor.
AM_PATH_SDL2 doesn't add much beyond PKG_CHECK_MODULES, and having a
special m4 macro for every library that you might depend on scales
poorly.
The macro does add special support for macOS frameworks, but that feature
was broken for around 6 years without anyone noticing (#6141), and is
likely to be only rarely useful according to comments on #6141.
Resolves: #6140
Signed-off-by: Simon McVittie <smcv@collabora.com>
Library-specific foo-config scripts duplicate very similar logic across
various different projects, and tend to break cross-compiling, multilib
(gcc -m32), Debian/Ubuntu multiarch and so on by only being able to have
one sdl2-config at a time as the first one in the PATH.
The direct replacement is pkg-config(1) or a compatible reimplementation
like pkgconf(1), which relies on each library installing declarative
metadata, like SDL's sdl2.pc (available since at least 2.0.0) and
centralizes the logic into the pkg-config/pkgconf tool.
Most uses of `sdl2-config --foo` can be replaced by something similar
to `${PKG_CONFIG:-pkg-config} --foo sdl2`. Instead of adding a custom
sdl2-config to the PATH or using its --prefix or --exec-prefix options,
users of a custom installation prefix can use any of pkg-config's
non-SDL-specific ways to influence the result, for example setting
PKG_CONFIG_PATH, PKG_CONFIG_SYSROOT_DIR or PKG_CONFIG_LIBDIR environment
variables, or setting the PKG_CONFIG environment variable to point to
a wrapper script.
For Autotools specifically, the replacement for AM_PATH_SDL2 (which
will be officially deprecated in a subsequent commit) is
PKG_CHECK_MODULES.
CMake has its own semi-declarative mechanism for dependency discovery,
"config packages", and the SDL build already installs a config
package. There's a good example of using a config package to discover
SDL in `cmake/test/`.
Meson natively supports pkg-config, and already uses it in preference
to sdl2-config.
Other build systems can run pkg-config instead of sdl2-config,
preferably checking the PKG_CONFIG environment variable first.
https://github.com/ioquake/ioq3 is a good example of a project doing
this correctly.
Helps: #6140, #3516
Signed-off-by: Simon McVittie <smcv@collabora.com>