X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_joystick.c;h=046e62fd49a0765c0df0114894173e9e1763aca2;hb=9807c5fdb2f20f098c7046786908a7f3ce1dc2d4;hp=fb77bb4584253525102876b2a36b2d7b641d8d10;hpb=2c9161e532490d2623896ad4720fb5e7bb6480bb;p=freeglut diff --git a/src/freeglut_joystick.c b/src/freeglut_joystick.c index fb77bb4..046e62f 100644 --- a/src/freeglut_joystick.c +++ b/src/freeglut_joystick.c @@ -31,19 +31,21 @@ * Many thanks for Steve Baker for permission to pull from that library. */ -#if defined( __FreeBSD__ ) || defined( __NetBSD__ ) -# include -#endif - #include #include "freeglut_internal.h" +#if HAVE_SYS_PARAM_H +# include +#endif /* * Initial defines from "js.h" starting around line 33 with the existing "freeglut_joystick.c" * interspersed */ -#define _JS_MAX_BUTTONS 32 +/* XXX It might be better to poll the operating system for the numbers of buttons and + * XXX axes and then dynamically allocate the arrays. + */ +#define _JS_MAX_BUTTONS 32 #if TARGET_HOST_MACINTOSH # define _JS_MAX_AXES 9 @@ -61,18 +63,23 @@ # define _JS_MAX_AXES 8 # include # include -# include # include #endif #if TARGET_HOST_UNIX_X11 # define _JS_MAX_AXES 16 +# if HAVE_SYS_IOCTL_H +# include +# endif +# if HAVE_FCNTL_H +# include +# endif +# include # if defined(__FreeBSD__) || defined(__NetBSD__) /* XXX The below hack is done until freeglut's autoconf is updated. */ # define HAVE_USB_JS 1 -# include # if defined(__FreeBSD__) && __FreeBSD_version >= 500000 # include # else @@ -89,11 +96,7 @@ # define JS_RETURN (sizeof(struct JS_DATA_TYPE)) # endif -# include -# include - # if defined(__linux__) -# include # include /* check the joystick driver version */