+# include <machine/joystick.h> /* For analog joysticks */\r
+# endif\r
+# define JS_DATA_TYPE joystick\r
+# define JS_RETURN (sizeof(struct JS_DATA_TYPE))\r
+# endif\r
+\r
+# if defined(__linux__)\r
+# include <linux/joystick.h>\r
+\r
+/* check the joystick driver version */\r
+# if defined(JS_VERSION) && JS_VERSION >= 0x010000\r
+# define JS_NEW\r
+# endif\r
+# else /* Not BSD or Linux */\r
+# ifndef JS_RETURN\r
+\r
+ /*\r
+ * We'll put these values in and that should\r
+ * allow the code to at least compile when there is\r
+ * no support. The JS open routine should error out\r
+ * and shut off all the code downstream anyway and if\r
+ * the application doesn't use a joystick we'll be fine.\r
+ */\r
+\r
+ struct JS_DATA_TYPE\r
+ {\r
+ int buttons;\r
+ int x;\r
+ int y;\r
+ };\r
+\r
+# define JS_RETURN (sizeof(struct JS_DATA_TYPE))\r
+# endif\r
+# endif\r
+#endif\r
+\r
+/* XXX It might be better to poll the operating system for the numbers of buttons and\r
+ * XXX axes and then dynamically allocate the arrays.\r
+ */\r
+#define _JS_MAX_BUTTONS 32\r
+\r