From: Richard Rauch Date: Wed, 1 Oct 2003 16:30:25 +0000 (+0000) Subject: Applied a patch from "extraeme@netbsd.org" to add joystick support. X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;ds=sidebyside;h=f399c1be8440abd7ec6af0c09436e5adfa289182;hp=45881dfa9c7c9eaa9c2e88e0a357be3b6e6c2e87;p=freeglut Applied a patch from "extraeme@netbsd.org" to add joystick support. Untested, but it compiles for me. Should also add Joystick support for older FreeBSD systems. Also untested. git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@211 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/src/freeglut_joystick.c b/src/freeglut_joystick.c index 1c0e321..82fc444 100644 --- a/src/freeglut_joystick.c +++ b/src/freeglut_joystick.c @@ -56,8 +56,12 @@ #else # include # include -# ifdef __FreeBSD__ +# if defined(__FreeBSD__) || defined(__NetBSD__) +# if __FreeBSD_version >= 500000 # include +# else +# include +# endif # define JS_DATA_TYPE joystick # define JS_RETURN (sizeof(struct JS_DATA_TYPE)) # elif defined(__linux__) @@ -253,7 +257,7 @@ static void fghJoystickRawRead ( SFG_Joystick* joy, int* buttons, float* axes ) } if( buttons ) -# ifdef __FreeBSD__ +# if defined(__FreeBSD__) || defined(__NetBSD__) *buttons = (joy->js.b1 ? 1 : 0) | (joy->js.b2 ? 2 : 0); # else *buttons = joy->js.buttons;