mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-01 09:27:39 +00:00
Fix uses of undefined macro identifiers (-Wundef)
* Fix -Wundef warnings due to use of unguarded SDL_LOADSO_DISABLED
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_WINDOWS
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_ANDROID
* Fix -Wundef warnings due to use of unguarded SDL_LOADSO_DUMMY
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_COCOA
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_UIKIT
* Fix -Wundef warnings due to use of unguarded SDL_TIMERS_DISABLED
* Fix -Wundef warnings due to use of unguarded SDL_EVENTS_DISABLED
* Fix -Wundef warnings due to use of unguarded SDL_TIMER_DUMMY
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DISABLED
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DISABLED
* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_DISABLED
* Fix -Wundef warnings due to use of unguarded SDL_HAPTIC_DISABLED
* Fix -Wundef warnings due to use of unguarded SDL_SENSOR_DISABLED
* Fix -Wundef warnings due to use of unguarded __ANDROID__
* Fix -Wundef warnings due to use of unguarded __IOS__
* Fix -Wundef warnings due to use of unguarded EMULATE_CAS
* Fix -Wundef warnings due to use of unguarded SDL_ATOMIC_DISABLED
* Fix -Wundef warnings due to use of unguarded SDL_THREADS_DISABLED
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_SNDIO
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_NETBSD
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_WASAPI
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_DSOUND
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_HAIKU
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_COREAUDIO
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_AAUDIO
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_OPENSLES
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_ANDROID
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_PS2
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_PSP
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_VITA
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_N3DS
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_EMSCRIPTEN
* Fix -Wundef warnings due to use of unguarded SDL_NEON_INTRINSICS
* Fix -Wundef warnings due to use of unguarded SDL_ALTIVEC_BLITTERS
* Fix -Wundef warnings due to use of unguarded __VITA__
* Fix -Wundef warnings due to use of unguarded __3DS__
* Fix -Wundef warnings due to use of unguarded SDL_DYNAPI_PROC_NO_VARARGS
* Fix -Wundef warnings due to use of unguarded __APPLE__
* Fix -Wundef warnings due to use of unguarded __WINRT__
* Fix -Wundef warnings due to use of unguarded SDL_HIDAPI_DISABLED
* Fix -Wundef warnings due to use of unguarded __TVOS__
* Fix -Wundef warnings due to use of unguarded HAVE_DRIVER_BACKEND
* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_XINPUT
* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_WGI
* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_DINPUT
* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_MFI
* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_EMSCRIPTEN
* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_PS2
* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_PSP
* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_VITA
* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_N3DS
* Fix -Wundef warnings due to use of unguarded __MACOS__
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_D3D
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_WINRT
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_RPI
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_VITA_PVR_OGL
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_VIVANTE
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_D3D11
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_D3D12
* Fix -Wundef warnings due to use of unguarded SDL_RENDER_DISABLED
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_METAL
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_PS2
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_PSP
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_VITA_GXM
* Fix -Wundef warnings due to use of unguarded SDL_ARM_SIMD_BLITTERS
* Fix -Wundef warnings due to use of unguarded SDL_ARM_NEON_BLITTERS
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_HAIKU
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_PS2
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_PSP
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_VITA
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_N3DS
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_KMSDRM
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_RISCOS
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_EMSCRIPTEN
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_NGAGE
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_METAL
* Fix -Wundef warnings due to use of unguarded SDL_LSX_INTRINSICS
* Fix -Wundef warnings due to use of unguarded HAVE_PTHREAD_NP_H
* Fix -Wundef warnings due to use of unguarded __RISCOS__
* Fix -Wundef warnings due to use of unguarded FAKE_RECURSIVE_MUTEX
* Fix -Wundef warnings due to use of unguarded USE_POSIX_SPAWN
* textureData is only needed when SDL is built with YUV support
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_ALSA
* Fix -Wundef warnings due to use of unguarded SDL_SSE3_INTRINSICS
* Fix -Wundef warnings due to use of unguarded SDL_SSE4_2_INTRINSICS
* Fix -Wundef warnings due to use of unguarded SDL_SSE4_1_INTRINSICS
* Fix -Wundef warnings due to use of unguarded SDL_AVX512F_INTRINSICS
* Fix -Wundef warnings due to use of unguarded SDL_SSE2_INTRINSICS
* Fix -Wundef warnings due to use of unguarded SDL_AVX_INTRINSICS
* Fix -Wundef warnings due to use of unguarded SDL_AVX2_INTRINSICS
* Fix -Wundef warnings due to use of unguarded SDL_SSE_INTRINSICS
* Fix -Wundef warnings due to use of unguarded SDL_MMX_INTRINSICS
* Fix -Wundef warnings due to use of unguarded HAVE_CLOCK_GETTIME
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_DISK
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_DUMMY
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_DUMMY
* Fix -Wundef warnings due to use of unguarded HAVE_GCC_ATOMICS
* Fix -Wundef warnings due to use of unguarded HAVE_GCC_SYNC_LOCK_TEST_AND_SET
* Fix -Wundef warnings due to use of unguarded SDL_USE_LIBDBUS
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_JACK
* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_VIRTUAL
* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_LINUX
* Fix -Wundef warnings due to use of unguarded HAVE_LIBC
* Fix -Wundef warnings due to disabling SDL_LIBC
* Fix -Wundef warnings due to use of unguarded HAVE_PLATFORM_BACKEND
* Fix -Wundef warnings due to use of unguarded DEBUG
* Fix -Wundef warnings due to use of unguarded HAVE_LINUX_INPUT_H
* Fix -Werror=unused-variable when building with SDL_LIBC=OFF
* Fix -Wundef warnings due to use of unguqrded SDL_USE_LIBUDEV
* Use SDL alloc functions in libusb/hid.c
* Fix -Wundef warnings due to use of unguarded HAVE_LIBUDEV_H
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_VULKAN
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_OFFSCREEN
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_OGL
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_GLX
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_ES
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_ES2
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_OGL_ES2
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_OSS
* Remove SDL_AUDIO_DRIVER_SUNAUDIO reference since it is never set
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_PIPEWIRE
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_PULSEAUDIO
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_XCURSOR
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_XDBE
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_XFIXES
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_XINPUT2
* Fix -Wundef warnings due to use of unguarded #if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
* Fix -Wundef warnings due to use of unguarded #if SDL_VIDEO_DRIVER_X11_XRANDR
* Fix -Wundef warnings due to use of unguarded #if SDL_VIDEO_DRIVER_X11_XSCRNSAVER
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_XSHAPE
* Don't call XShape functions when XShape is diabled
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_WAYLAND
* Fix -Wundef warnings due to use of unuarded SDL_VIDEO_DRIVER_X11
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_RISCOS
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_EGL
* Disable array when compiled with SDL_EVENTS=OFF
* Fix -Wundef warnings due to use of unguarded SDL_INPUT_LINUXEV
* Fix -Wundef warnings due to use of unguarded SDL_THREAD_PTHREAD
* Fix -Wundef warnings due to use of unguarded SDL_THREAD_WINDOWS
* Fix -Wundef warnings due to use of unguarded SDL_THREAD_PS2
* Fix -Wundef warnings due to use of unguarded SDL_THREAD_PSP
* Fix -Wundef warnings due to use of unguarded SDL_THREAD_VITA
* Fix -Wundef warnings due to use of unguarded SDL_THREAD_N3DS
* Fix -Wundef warnings due to use of unguarded SDL_THREAD_STDCPP
* Fix -Wundef warnings due to use of unguarded SDL_THREAD_NGAGE
* Fix -Wundef warnings due to use of unguarded __WINDOWS__
* Fix -Wundef warnings due to use of unguarded __WINGDK__
* Fix -Wundef warnings due to use of unguarded __ANDROID__
* Fix -Wundef warnings due to use of unguarded SDL_THREAD_GENERIC_COND_SUFFIX
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_VITA_PIB
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_VITA_PVR
* Fix -Wundef warnings due to use of unguarded SDL_FILE_DISABLED
* Fix -Wundef warnings due to use of unguarded __XBOXONE__
* Fix -Wundef warnings due to use of unguarded __XBOXSERIES__
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_WGL
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_QNX
* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_DISK
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_QNX
* Fix -Wundef warnings due to use of unguarded DEBUG_RAZOR
* Fix -Wundef warnings due to use of unguarded WINAPI_FAMILY_PHONE_APP
* Fix -Wundef warnings due to use of unguarded SDL_MAC_NO_SANDBOX
* Fix -Wundef warnings due to use of unguarded __(IPHONE|APPLETV|MAC)_OS_VERSION_MAX_ALLOWED
* Fix C4090 warning ('function': different 'const' qualifiers)
* ci: use -isystem for include dirs of pspdev toolchain
* cmake: add -Wundef option
* Fix remaining -Wundef warnings due to use of unguarded SDL_VIDEO_VULKAN and SDL_VIDEO_METAL
* Fix -Wundef warnings due to use of unguarded __MACOS__
* DEBUG_CONVERT is guaranteed to be defined in src/audio/SDL_audiocvt.c
* Fix -Wundef warnings due to use of unguarded HAVE_NANOSLEEP
* Fix -Wundef warnings due to use of unguarded HAVE_DXGI_H
* Fix -Wundef warnings due to use of unguarded HAVE_LINUX_INPUT_H
* fix SDL_VIDEO_DRIVER_WAYLAND
* fix SDL_VIDEO_DRIVER_X11
* Fix -Wundef warnings due to use of unguarded HAVE_MMDEVICEAPI_H
* Fix -Wundef warnings due to use of unguarded HAVE_PTHREAD_SETNAME_NP
* Fix -Wundef warnings due to use of unguarded HAVE_PTHREAD_SET_NAME_NP
* Fix -Wundef warnings due to use of unguarded HAVE_SETJMP
* Fix -Wundef warnings due to use of unguarded HAVE_SIGNAL_H
* Fix -Wundef warnings due to use of unguarded HAVE_TPCSHRD_H
* Fix -Wundef warnings due to use of unguarded MACOSX_COREAUDIO
* Fix -Wundef warnings due to use of unguarded SDL_HAPTIC_DINPUT
* Fix -Wundef warnings due to use of unguarded SDL_HAPTIC_IOKIT
* Fix -Wundef warnings due to use of unguarded SDL_HAPTIC_XINPUT
* Fix -Wundef warnings due to use of unguarded SDL_IPHONE_KEYBOARD
* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_RAWINPUT
* Fix -Wundef warnings due to use of unguarded SDL_POWER_ANDROID
* Fix -Wundef warnings due to use of unguarded SDL_POWER_EMSCRIPTEN
* Fix -Wundef warnings due to use of unguarded SDL_POWER_HAIKU
* Fix -Wundef warnings due to use of unguarded SDL_POWER_LINUX
* Fix -Wundef warnings due to use of unguarded SDL_POWER_MACOSX
* Fix -Wundef warnings due to use of unguarded SDL_POWER_PSP
* Fix -Wundef warnings due to use of unguarded SDL_POWER_UIKIT
* Fix -Wundef warnings due to use of unguarded SDL_POWER_VITA
* Fix -Wundef warnings due to use of unguarded SDL_POWER_WINDOWS
* Fix -Wundef warnings due to use of unguarded SDL_THREAD_PTHREAD_RECURSIVE_MUTEX
* Fix -Wundef warnings due to use of unguarded SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_VIVANTE_VDK
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_WAYLAND
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_CGL
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_EGL
* Fix -Wundef warnings due to use of unguarded __MACOS__
* Fix -Wundef warnings due to use of unguarded __OpenBSD__
* Fix -Wundef warnings due to use of unguarded __FreeBSD__
* Fix -Wundef warnings due to use of unguarded __MWERKS__
* Fix -Wundef warnings due to use of unguarded __WIN32__
* Fix -Wundef warnings due to use of unguarded SDL_IPHONE_LAUNCHSCREEN
* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_ES2
* Remove unused HAVE_CONST, HAVE_INLINE and HAVE_VOLATILE
* Revert "Use SDL alloc functions in libusb/hid.c"
This reverts commit 847c64b00d
.
* Handle FAKE_RECURSIVE_MUTEX in similar way as SDL2
* Don't use defined in macro
This commit is contained in:
parent
c3d3c2c672
commit
3472dc11d6
382 changed files with 1222 additions and 1184 deletions
|
@ -27,7 +27,7 @@
|
|||
#include "SDL_gamepad_c.h"
|
||||
#include "SDL_joystick_c.h"
|
||||
|
||||
#if !SDL_EVENTS_DISABLED
|
||||
#ifndef SDL_EVENTS_DISABLED
|
||||
#include "../events/SDL_events_c.h"
|
||||
#endif
|
||||
#include "../video/SDL_sysvideo.h"
|
||||
|
@ -44,7 +44,7 @@
|
|||
#include <tlhelp32.h>
|
||||
#endif
|
||||
|
||||
#if SDL_JOYSTICK_VIRTUAL
|
||||
#ifdef SDL_JOYSTICK_VIRTUAL
|
||||
#include "./virtual/SDL_virtualjoystick_c.h"
|
||||
#endif
|
||||
|
||||
|
@ -301,7 +301,7 @@ int SDL_InitJoysticks(void)
|
|||
SDL_joystick_lock = SDL_CreateMutex();
|
||||
}
|
||||
|
||||
#if !SDL_EVENTS_DISABLED
|
||||
#ifndef SDL_EVENTS_DISABLED
|
||||
if (SDL_InitSubSystem(SDL_INIT_EVENTS) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
@ -631,7 +631,7 @@ SDL_JoystickID SDL_AttachVirtualJoystick(SDL_JoystickType type, int naxes, int n
|
|||
|
||||
SDL_JoystickID SDL_AttachVirtualJoystickEx(const SDL_VirtualJoystickDesc *desc)
|
||||
{
|
||||
#if SDL_JOYSTICK_VIRTUAL
|
||||
#if defined(SDL_JOYSTICK_VIRTUAL)
|
||||
SDL_JoystickID retval;
|
||||
|
||||
SDL_LockJoysticks();
|
||||
|
@ -645,7 +645,7 @@ SDL_JoystickID SDL_AttachVirtualJoystickEx(const SDL_VirtualJoystickDesc *desc)
|
|||
|
||||
int SDL_DetachVirtualJoystick(SDL_JoystickID instance_id)
|
||||
{
|
||||
#if SDL_JOYSTICK_VIRTUAL
|
||||
#if defined(SDL_JOYSTICK_VIRTUAL)
|
||||
int retval;
|
||||
|
||||
SDL_LockJoysticks();
|
||||
|
@ -659,7 +659,7 @@ int SDL_DetachVirtualJoystick(SDL_JoystickID instance_id)
|
|||
|
||||
SDL_bool SDL_IsJoystickVirtual(SDL_JoystickID instance_id)
|
||||
{
|
||||
#if SDL_JOYSTICK_VIRTUAL
|
||||
#if defined(SDL_JOYSTICK_VIRTUAL)
|
||||
SDL_JoystickDriver *driver;
|
||||
int device_index;
|
||||
SDL_bool is_virtual = SDL_FALSE;
|
||||
|
@ -686,7 +686,7 @@ int SDL_SetJoystickVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value)
|
|||
{
|
||||
CHECK_JOYSTICK_MAGIC(joystick, -1);
|
||||
|
||||
#if SDL_JOYSTICK_VIRTUAL
|
||||
#if defined(SDL_JOYSTICK_VIRTUAL)
|
||||
retval = SDL_SetJoystickVirtualAxisInner(joystick, axis, value);
|
||||
#else
|
||||
retval = SDL_SetError("SDL not built with virtual-joystick support");
|
||||
|
@ -705,7 +705,7 @@ int SDL_SetJoystickVirtualButton(SDL_Joystick *joystick, int button, Uint8 value
|
|||
{
|
||||
CHECK_JOYSTICK_MAGIC(joystick, -1);
|
||||
|
||||
#if SDL_JOYSTICK_VIRTUAL
|
||||
#if defined(SDL_JOYSTICK_VIRTUAL)
|
||||
retval = SDL_SetJoystickVirtualButtonInner(joystick, button, value);
|
||||
#else
|
||||
retval = SDL_SetError("SDL not built with virtual-joystick support");
|
||||
|
@ -724,7 +724,7 @@ int SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value)
|
|||
{
|
||||
CHECK_JOYSTICK_MAGIC(joystick, -1);
|
||||
|
||||
#if SDL_JOYSTICK_VIRTUAL
|
||||
#if defined(SDL_JOYSTICK_VIRTUAL)
|
||||
retval = SDL_SetJoystickVirtualHatInner(joystick, hat, value);
|
||||
#else
|
||||
retval = SDL_SetError("SDL not built with virtual-joystick support");
|
||||
|
@ -1304,7 +1304,7 @@ void SDL_QuitJoysticks(void)
|
|||
SDL_joystick_player_count = 0;
|
||||
}
|
||||
|
||||
#if !SDL_EVENTS_DISABLED
|
||||
#ifndef SDL_EVENTS_DISABLED
|
||||
SDL_QuitSubSystem(SDL_INIT_EVENTS);
|
||||
#endif
|
||||
|
||||
|
@ -1404,7 +1404,7 @@ void SDL_PrivateJoystickAdded(SDL_JoystickID instance_id)
|
|||
SDL_SetJoystickIDForPlayerIndex(player_index, instance_id);
|
||||
}
|
||||
|
||||
#if !SDL_EVENTS_DISABLED
|
||||
#ifndef SDL_EVENTS_DISABLED
|
||||
{
|
||||
SDL_Event event;
|
||||
|
||||
|
@ -1454,7 +1454,7 @@ void SDL_PrivateJoystickRemoved(SDL_JoystickID instance_id)
|
|||
{
|
||||
SDL_Joystick *joystick = NULL;
|
||||
int player_index;
|
||||
#if !SDL_EVENTS_DISABLED
|
||||
#ifndef SDL_EVENTS_DISABLED
|
||||
SDL_Event event;
|
||||
#endif
|
||||
|
||||
|
@ -1469,7 +1469,7 @@ void SDL_PrivateJoystickRemoved(SDL_JoystickID instance_id)
|
|||
}
|
||||
}
|
||||
|
||||
#if !SDL_EVENTS_DISABLED
|
||||
#ifndef SDL_EVENTS_DISABLED
|
||||
event.type = SDL_EVENT_JOYSTICK_REMOVED;
|
||||
event.common.timestamp = 0;
|
||||
|
||||
|
@ -1538,7 +1538,7 @@ int SDL_SendJoystickAxis(Uint64 timestamp, SDL_Joystick *joystick, Uint8 axis, S
|
|||
|
||||
/* Post the event, if desired */
|
||||
posted = 0;
|
||||
#if !SDL_EVENTS_DISABLED
|
||||
#ifndef SDL_EVENTS_DISABLED
|
||||
if (SDL_EventEnabled(SDL_EVENT_JOYSTICK_AXIS_MOTION)) {
|
||||
SDL_Event event;
|
||||
event.type = SDL_EVENT_JOYSTICK_AXIS_MOTION;
|
||||
|
@ -1580,7 +1580,7 @@ int SDL_SendJoystickHat(Uint64 timestamp, SDL_Joystick *joystick, Uint8 hat, Uin
|
|||
|
||||
/* Post the event, if desired */
|
||||
posted = 0;
|
||||
#if !SDL_EVENTS_DISABLED
|
||||
#ifndef SDL_EVENTS_DISABLED
|
||||
if (SDL_EventEnabled(SDL_EVENT_JOYSTICK_HAT_MOTION)) {
|
||||
SDL_Event event;
|
||||
event.type = SDL_EVENT_JOYSTICK_HAT_MOTION;
|
||||
|
@ -1597,7 +1597,7 @@ int SDL_SendJoystickHat(Uint64 timestamp, SDL_Joystick *joystick, Uint8 hat, Uin
|
|||
int SDL_SendJoystickButton(Uint64 timestamp, SDL_Joystick *joystick, Uint8 button, Uint8 state)
|
||||
{
|
||||
int posted;
|
||||
#if !SDL_EVENTS_DISABLED
|
||||
#ifndef SDL_EVENTS_DISABLED
|
||||
SDL_Event event;
|
||||
|
||||
SDL_AssertJoysticksLocked();
|
||||
|
@ -1638,7 +1638,7 @@ int SDL_SendJoystickButton(Uint64 timestamp, SDL_Joystick *joystick, Uint8 butto
|
|||
|
||||
/* Post the event, if desired */
|
||||
posted = 0;
|
||||
#if !SDL_EVENTS_DISABLED
|
||||
#ifndef SDL_EVENTS_DISABLED
|
||||
if (SDL_EventEnabled(event.type)) {
|
||||
event.common.timestamp = timestamp;
|
||||
event.jbutton.which = joystick->instance_id;
|
||||
|
@ -1705,6 +1705,7 @@ void SDL_UpdateJoysticks(void)
|
|||
SDL_UnlockJoysticks();
|
||||
}
|
||||
|
||||
#ifndef SDL_EVENTS_DISABLED
|
||||
static const Uint32 SDL_joystick_event_list[] = {
|
||||
SDL_EVENT_JOYSTICK_AXIS_MOTION,
|
||||
SDL_EVENT_JOYSTICK_HAT_MOTION,
|
||||
|
@ -1714,6 +1715,7 @@ static const Uint32 SDL_joystick_event_list[] = {
|
|||
SDL_EVENT_JOYSTICK_REMOVED,
|
||||
SDL_EVENT_JOYSTICK_BATTERY_UPDATED
|
||||
};
|
||||
#endif
|
||||
|
||||
void SDL_SetJoystickEventsEnabled(SDL_bool enabled)
|
||||
{
|
||||
|
@ -2850,7 +2852,7 @@ void SDL_SendJoystickBatteryLevel(SDL_Joystick *joystick, SDL_JoystickPowerLevel
|
|||
|
||||
SDL_assert(joystick->ref_count); /* make sure we are calling this only for update, not for initialization */
|
||||
if (ePowerLevel != joystick->epowerlevel) {
|
||||
#if !SDL_EVENTS_DISABLED
|
||||
#ifndef SDL_EVENTS_DISABLED
|
||||
if (SDL_EventEnabled(SDL_EVENT_JOYSTICK_BATTERY_UPDATED)) {
|
||||
SDL_Event event;
|
||||
event.type = SDL_EVENT_JOYSTICK_BATTERY_UPDATED;
|
||||
|
@ -2954,7 +2956,7 @@ int SDL_SendJoystickTouchpad(Uint64 timestamp, SDL_Joystick *joystick, int touch
|
|||
|
||||
/* Post the event, if desired */
|
||||
posted = 0;
|
||||
#if !SDL_EVENTS_DISABLED
|
||||
#ifndef SDL_EVENTS_DISABLED
|
||||
if (SDL_EventEnabled(event_type)) {
|
||||
SDL_Event event;
|
||||
event.type = event_type;
|
||||
|
@ -2994,7 +2996,7 @@ int SDL_SendJoystickSensor(Uint64 timestamp, SDL_Joystick *joystick, SDL_SensorT
|
|||
SDL_memcpy(sensor->data, data, num_values * sizeof(*data));
|
||||
|
||||
/* Post the event, if desired */
|
||||
#if !SDL_EVENTS_DISABLED
|
||||
#ifndef SDL_EVENTS_DISABLED
|
||||
if (SDL_EventEnabled(SDL_EVENT_GAMEPAD_SENSOR_UPDATE)) {
|
||||
SDL_Event event;
|
||||
event.type = SDL_EVENT_GAMEPAD_SENSOR_UPDATE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue