Skip to content

Commit 0979ad5

Browse files
committed
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.
1 parent 08814d1 commit 0979ad5

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,7 @@ if(SDL_JOYSTICK)
13771377
endif()
13781378

13791379
# DSU (DualShock UDP) client support
1380-
if(SDL_DSU_JOYSTICK AND NOT EMSCRIPTEN)
1380+
if(SDL_DSU_JOYSTICK AND NOT EMSCRIPTEN AND (WINDOWS OR LINUX OR ANDROID OR HAIKU OR FREEBSD OR NETBSD OR OPENBSD OR MACOS))
13811381
set(SDL_JOYSTICK_DSU 1)
13821382
sdl_glob_sources(
13831383
"${SDL3_SOURCE_DIR}/src/joystick/dsu/*.c"

src/joystick/dsu/SDL_dsujoystick.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ typedef int socklen_t;
6161
#include <fcntl.h>
6262
#include <unistd.h>
6363
#include <errno.h>
64-
#include <sys/ioctl.h>
64+
#ifdef HAVE_SYS_IOCTL_H
65+
#include <sys/ioctl.h>
66+
#endif
6567
#ifdef __sun
6668
#include <sys/filio.h>
6769
#endif

src/joystick/dsu/SDL_dsujoystick_driver.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,6 @@ extern SDL_JoystickDriver SDL_DSU_JoystickDriver;
6464
/* Global DSU context pointer */
6565
struct DSU_Context_t *s_dsu_ctx = NULL;
6666

67-
/* Helper function to work around macro issues */
68-
static SDL_INLINE SDL_Mutex* GetDSUMutex(void) {
69-
struct DSU_Context_t *ctx = s_dsu_ctx;
70-
return ctx ? ctx->slots_mutex : NULL;
71-
}
72-
7367
/* Forward declarations */
7468
extern int SDLCALL DSU_ReceiverThread(void *data);
7569
extern void DSU_RequestControllerInfo(struct DSU_Context_t *ctx, Uint8 slot);

0 commit comments

Comments
 (0)