Commit 2376458841839cec2e92da4b99037b1c5322e8f7

Ozkan Sezer 2021-01-23T17:24:28

renamed SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H to SDL_HAVE_MACHINE_JOYSTICK_H

diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index ea70774..74f0b19 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 c793e31..1570e01 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 3a24688..cd3ce72 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 b006545..977050d 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 d40cac5..eb2b417 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 2a2d797..57c44ba 100644
--- a/src/joystick/bsd/SDL_bsdjoystick.c
+++ b/src/joystick/bsd/SDL_bsdjoystick.c
@@ -69,7 +69,7 @@
 #include <sys/joystick.h>
 #endif
 
-#if SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
+#if SDL_HAVE_MACHINE_JOYSTICK_H
 #include <machine/joystick.h>
 #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;