Fix build on NetBSD.
authorThomas Klausner <wiz@NetBSD.org>
Wed, 12 Jul 2017 20:44:35 +0000 (20:44 +0000)
committerDiederick Niehorster <dcnieho@gmail.com>
Wed, 12 Jul 2017 20:44:35 +0000 (20:44 +0000)
(cherry picked from commit 06e1d815cf9abda49b845754ff420734446eb95b)

(cherry picked from commit c4294ad59093c27159ea6028d33e3c9581df5354)

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1829 7f0cb862-5218-0410-a997-914c9d46530a

src/fg_joystick.c
src/x11/fg_joystick_x11.c

index 6f6771c..b73d7e7 100644 (file)
 
 #    ifdef HAVE_USB_JS
 #        if defined(__NetBSD__)
-/* XXX The below hack is done until freeglut's autoconf is updated. */
-#            define HAVE_USBHID_H 1
 #            ifdef HAVE_USBHID_H
 #                include <usbhid.h>
 #            else
 #                include <usb.h>
 #            endif
+#            include <dev/usb/usb.h>
 #        elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #            ifdef HAVE_USBHID_H
 #                include <usbhid.h>
 #            else
 #                include <libusbhid.h>
 #            endif
+#            include <legacy/dev/usb/usb.h>
 #        endif
-#        include <legacy/dev/usb/usb.h>
 #        include <dev/usb/usbhid.h>
 
 /* Compatibility with older usb.h revisions */
index a37388b..04bc373 100644 (file)
@@ -50,7 +50,7 @@ void fgPlatformJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes )
 {
     int status;
 
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
     int len;
 
     if ( joy->pJoystick.os->is_analog )
@@ -215,7 +215,7 @@ void fgPlatformJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes )
 
 void fgPlatformJoystickOpen( SFG_Joystick* joy )
 {
-#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__) || defined( __NetBSD__ )
+#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__)
        int i = 0;
        char *cp;
 #endif
@@ -229,7 +229,7 @@ void fgPlatformJoystickOpen( SFG_Joystick* joy )
 #  endif
 #endif
 
-#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__) || defined( __NetBSD__ )
+#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__)
     for( i = 0; i < _JS_MAX_AXES; i++ )
         joy->pJoystick.os->cache_axes[ i ] = 0.0f;
 
@@ -409,7 +409,7 @@ void fgPlatformJoystickOpen( SFG_Joystick* joy )
 
 void fgPlatformJoystickInit( SFG_Joystick *fgJoystick[], int ident )
 {
-#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__) || defined( __NetBSD__ )
+#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__)
     fgJoystick[ ident ]->id = ident;
     fgJoystick[ ident ]->error = GL_FALSE;
 
@@ -436,7 +436,7 @@ void fgPlatformJoystickInit( SFG_Joystick *fgJoystick[], int ident )
 
 void fgPlatformJoystickClose ( int ident )
 {
-#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__) || defined( __NetBSD__ )
+#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__)
     if( fgJoystick[ident]->pJoystick.os )
     {
         if( ! fgJoystick[ ident ]->error )