X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_joystick.c;h=046e62fd49a0765c0df0114894173e9e1763aca2;hb=9807c5fdb2f20f098c7046786908a7f3ce1dc2d4;hp=30ad93b7b50803b5458f868b207b56a6008a3761;hpb=d296a46a2dccdd99048541e1f8ca0ef010ac8545;p=freeglut diff --git a/src/freeglut_joystick.c b/src/freeglut_joystick.c index 30ad93b..046e62f 100644 --- a/src/freeglut_joystick.c +++ b/src/freeglut_joystick.c @@ -31,23 +31,21 @@ * Many thanks for Steve Baker for permission to pull from that library. */ -#if defined( __FreeBSD__ ) || defined( __NetBSD__ ) -# include -#endif - -#ifdef HAVE_CONFIG_H -# include "config.h" -#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 @@ -65,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 @@ -93,12 +96,7 @@ # define JS_RETURN (sizeof(struct JS_DATA_TYPE)) # endif -# include -# include -# include - # if defined(__linux__) -# include # include /* check the joystick driver version */