Fix build on NetBSD.
(cherry picked from commit 06e1d815cf9abda49b845754ff420734446eb95b)
This commit is contained in:
parent
0b64b227b5
commit
c4294ad590
@ -46,21 +46,20 @@
|
|||||||
|
|
||||||
# ifdef HAVE_USB_JS
|
# ifdef HAVE_USB_JS
|
||||||
# if defined(__NetBSD__)
|
# if defined(__NetBSD__)
|
||||||
/* XXX The below hack is done until freeglut's autoconf is updated. */
|
|
||||||
# define HAVE_USBHID_H 1
|
|
||||||
# ifdef HAVE_USBHID_H
|
# ifdef HAVE_USBHID_H
|
||||||
# include <usbhid.h>
|
# include <usbhid.h>
|
||||||
# else
|
# else
|
||||||
# include <usb.h>
|
# include <usb.h>
|
||||||
# endif
|
# endif
|
||||||
|
# include <dev/usb/usb.h>
|
||||||
# elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
# elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
# ifdef HAVE_USBHID_H
|
# ifdef HAVE_USBHID_H
|
||||||
# include <usbhid.h>
|
# include <usbhid.h>
|
||||||
# else
|
# else
|
||||||
# include <libusbhid.h>
|
# include <libusbhid.h>
|
||||||
# endif
|
# endif
|
||||||
|
# include <legacy/dev/usb/usb.h>
|
||||||
# endif
|
# endif
|
||||||
# include <legacy/dev/usb/usb.h>
|
|
||||||
# include <dev/usb/usbhid.h>
|
# include <dev/usb/usbhid.h>
|
||||||
|
|
||||||
/* Compatibility with older usb.h revisions */
|
/* Compatibility with older usb.h revisions */
|
||||||
|
@ -50,7 +50,7 @@ void fgPlatformJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes )
|
|||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
|
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
if ( joy->pJoystick.os->is_analog )
|
if ( joy->pJoystick.os->is_analog )
|
||||||
@ -215,7 +215,7 @@ void fgPlatformJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes )
|
|||||||
|
|
||||||
void fgPlatformJoystickOpen( SFG_Joystick* joy )
|
void fgPlatformJoystickOpen( SFG_Joystick* joy )
|
||||||
{
|
{
|
||||||
#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__) || defined( __NetBSD__ )
|
#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__)
|
||||||
int i = 0;
|
int i = 0;
|
||||||
char *cp;
|
char *cp;
|
||||||
#endif
|
#endif
|
||||||
@ -229,7 +229,7 @@ void fgPlatformJoystickOpen( SFG_Joystick* joy )
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__) || defined( __NetBSD__ )
|
#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__)
|
||||||
for( i = 0; i < _JS_MAX_AXES; i++ )
|
for( i = 0; i < _JS_MAX_AXES; i++ )
|
||||||
joy->pJoystick.os->cache_axes[ i ] = 0.0f;
|
joy->pJoystick.os->cache_axes[ i ] = 0.0f;
|
||||||
|
|
||||||
@ -409,7 +409,7 @@ void fgPlatformJoystickOpen( SFG_Joystick* joy )
|
|||||||
|
|
||||||
void fgPlatformJoystickInit( SFG_Joystick *fgJoystick[], int ident )
|
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 ]->id = ident;
|
||||||
fgJoystick[ ident ]->error = GL_FALSE;
|
fgJoystick[ ident ]->error = GL_FALSE;
|
||||||
|
|
||||||
@ -436,7 +436,7 @@ void fgPlatformJoystickInit( SFG_Joystick *fgJoystick[], int ident )
|
|||||||
|
|
||||||
void fgPlatformJoystickClose ( 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]->pJoystick.os )
|
||||||
{
|
{
|
||||||
if( ! fgJoystick[ ident ]->error )
|
if( ! fgJoystick[ ident ]->error )
|
||||||
|
Reference in New Issue
Block a user