mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-11 00:55:20 +00:00
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:
parent
08814d1c1a
commit
0979ad52be
3 changed files with 4 additions and 8 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue