Restrict DSU joystick support to specific platforms

Updated CMakeLists.txt to enable DSU joystick support only on Windows, Linux, Android, Haiku, FreeBSD, NetBSD, OpenBSD, and macOS. Added conditional inclusion of <sys/ioctl.h> in SDL_dsujoystick.c. Removed unused GetDSUMutex helper from SDL_dsujoystick_driver.c.
This commit is contained in:
danprice142 2025-11-14 21:58:45 +00:00
parent 08814d1c1a
commit 0979ad52be
3 changed files with 4 additions and 8 deletions

View file

@ -1377,7 +1377,7 @@ if(SDL_JOYSTICK)
endif()
# DSU (DualShock UDP) client support
if(SDL_DSU_JOYSTICK AND NOT EMSCRIPTEN)
if(SDL_DSU_JOYSTICK AND NOT EMSCRIPTEN AND (WINDOWS OR LINUX OR ANDROID OR HAIKU OR FREEBSD OR NETBSD OR OPENBSD OR MACOS))
set(SDL_JOYSTICK_DSU 1)
sdl_glob_sources(
"${SDL3_SOURCE_DIR}/src/joystick/dsu/*.c"

View file

@ -61,7 +61,9 @@ typedef int socklen_t;
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <sys/ioctl.h>
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#ifdef __sun
#include <sys/filio.h>
#endif

View file

@ -64,12 +64,6 @@ extern SDL_JoystickDriver SDL_DSU_JoystickDriver;
/* Global DSU context pointer */
struct DSU_Context_t *s_dsu_ctx = NULL;
/* Helper function to work around macro issues */
static SDL_INLINE SDL_Mutex* GetDSUMutex(void) {
struct DSU_Context_t *ctx = s_dsu_ctx;
return ctx ? ctx->slots_mutex : NULL;
}
/* Forward declarations */
extern int SDLCALL DSU_ReceiverThread(void *data);
extern void DSU_RequestControllerInfo(struct DSU_Context_t *ctx, Uint8 slot);