From 2376458841839cec2e92da4b99037b1c5322e8f7 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Sat, 23 Jan 2021 17:24:28 +0300 Subject: [PATCH] renamed SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H to SDL_HAVE_MACHINE_JOYSTICK_H --- cmake/sdlchecks.cmake | 2 +- configure | 3 ++- configure.ac | 3 ++- include/SDL_config.h.cmake | 2 +- include/SDL_config.h.in | 2 +- src/joystick/bsd/SDL_bsdjoystick.c | 6 +++--- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake index ea707742e..74f0b198f 100644 --- a/cmake/sdlchecks.cmake +++ b/cmake/sdlchecks.cmake @@ -1082,7 +1082,7 @@ macro(CheckUSBHID) return 0; }" HAVE_MACHINE_JOYSTICK) if(HAVE_MACHINE_JOYSTICK) - set(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H 1) + set(SDL_HAVE_MACHINE_JOYSTICK_H 1) endif() set(SDL_JOYSTICK_USBHID 1) file(GLOB BSD_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/bsd/*.c) diff --git a/configure b/configure index c793e3160..1570e0101 100755 --- a/configure +++ b/configure @@ -24447,7 +24447,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test x$have_machine_joystick = xyes; then -$as_echo "#define SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H 1" >>confdefs.h +$as_echo "#define SDL_HAVE_MACHINE_JOYSTICK_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_machine_joystick" >&5 @@ -24461,6 +24461,7 @@ $as_echo "#define SDL_JOYSTICK_USBHID 1" >>confdefs.h EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS" have_joystick=yes fi + CFLAGS="$save_CFLAGS" fi ;; diff --git a/configure.ac b/configure.ac index 3a2468855..cd3ce722c 100644 --- a/configure.ac +++ b/configure.ac @@ -3369,7 +3369,7 @@ CheckUSBHID() have_machine_joystick=yes ]) if test x$have_machine_joystick = xyes; then - AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H, 1, [ ]) + AC_DEFINE(SDL_HAVE_MACHINE_JOYSTICK_H, 1, [ ]) fi AC_MSG_RESULT($have_machine_joystick) @@ -3379,6 +3379,7 @@ CheckUSBHID() EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS" have_joystick=yes fi + CFLAGS="$save_CFLAGS" fi ;; diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake index b006545a5..977050db3 100644 --- a/include/SDL_config.h.cmake +++ b/include/SDL_config.h.cmake @@ -307,7 +307,7 @@ #cmakedefine SDL_JOYSTICK_WINMM @SDL_JOYSTICK_WINMM@ #cmakedefine SDL_JOYSTICK_OS2 @SDL_JOYSTICK_OS2@ #cmakedefine SDL_JOYSTICK_USBHID @SDL_JOYSTICK_USBHID@ -#cmakedefine SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H @SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H@ +#cmakedefine SDL_HAVE_MACHINE_JOYSTICK_H @SDL_HAVE_MACHINE_JOYSTICK_H@ #cmakedefine SDL_JOYSTICK_HIDAPI @SDL_JOYSTICK_HIDAPI@ #cmakedefine SDL_JOYSTICK_EMSCRIPTEN @SDL_JOYSTICK_EMSCRIPTEN@ #cmakedefine SDL_JOYSTICK_VIRTUAL @SDL_JOYSTICK_VIRTUAL@ diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index d40cac513..eb2b4172c 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -309,7 +309,7 @@ #undef SDL_JOYSTICK_WINMM #undef SDL_JOYSTICK_OS2 #undef SDL_JOYSTICK_USBHID -#undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H +#undef SDL_HAVE_MACHINE_JOYSTICK_H #undef SDL_JOYSTICK_HIDAPI #undef SDL_JOYSTICK_RAWINPUT #undef SDL_JOYSTICK_EMSCRIPTEN diff --git a/src/joystick/bsd/SDL_bsdjoystick.c b/src/joystick/bsd/SDL_bsdjoystick.c index 2a2d79726..57c44ba40 100644 --- a/src/joystick/bsd/SDL_bsdjoystick.c +++ b/src/joystick/bsd/SDL_bsdjoystick.c @@ -69,7 +69,7 @@ #include #endif -#if SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H +#if SDL_HAVE_MACHINE_JOYSTICK_H #include #endif @@ -546,7 +546,7 @@ BSD_JoystickUpdate(SDL_Joystick *joy) Sint32 dpad[4] = {0, 0, 0, 0}; #endif -#if defined(__FREEBSD__) || SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H || defined(__FreeBSD_kernel__) || defined(__DragonFly_) +#if defined(__FREEBSD__) || SDL_HAVE_MACHINE_JOYSTICK_H || defined(__FreeBSD_kernel__) || defined(__DragonFly_) struct joystick gameport; static int x, y, xmin = 0xffff, ymin = 0xffff, xmax = 0, ymax = 0; @@ -591,7 +591,7 @@ BSD_JoystickUpdate(SDL_Joystick *joy) } return; } -#endif /* defined(__FREEBSD__) || SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H */ +#endif /* defined(__FREEBSD__) || SDL_HAVE_MACHINE_JOYSTICK_H */ rep = &joy->hwdata->inreport;