diff src/joystick/linux/SDL_sysjoystick.c @ 1361:19418e4422cb

New configure-based build system. Still work in progress, but much improved
author Sam Lantinga <slouken@libsdl.org>
date Thu, 16 Feb 2006 10:11:48 +0000
parents c71e05b4dc2e
children c0a74f199ecf
line wrap: on
line diff
--- a/src/joystick/linux/SDL_sysjoystick.c	Fri Feb 10 07:29:08 2006 +0000
+++ b/src/joystick/linux/SDL_sysjoystick.c	Thu Feb 16 10:11:48 2006 +0000
@@ -31,13 +31,13 @@
 #include <linux/limits.h> /* Arm cross-compiler needs this */
 #endif
 #include <linux/joystick.h>
-#ifdef USE_INPUT_EVENTS
+#if SDL_INPUT_LINUXEV
 #include <linux/input.h>
 #endif
 
 #include "SDL_joystick.h"
-#include "SDL_sysjoystick.h"
-#include "SDL_joystick_c.h"
+#include "../SDL_sysjoystick.h"
+#include "../SDL_joystick_c.h"
 
 /* Special joystick configurations */
 static struct {
@@ -168,7 +168,7 @@
 	} *balls;
 
 	/* Support for the Linux 2.4 unified input interface */
-#ifdef USE_INPUT_EVENTS
+#if SDL_INPUT_LINUXEV
 	SDL_bool is_hid;
 	Uint8 key_map[KEY_MAX-BTN_MISC];
 	Uint8 abs_map[ABS_MAX];
@@ -257,7 +257,7 @@
 
 #endif /* USE_LOGICAL_JOYSTICKS */
 
-#ifdef USE_INPUT_EVENTS
+#if SDL_INPUT_LINUXEV
 #define test_bit(nr, addr) \
 	(((1UL << ((nr) & 31)) & (((const unsigned int *) addr)[(nr) >> 5])) != 0)
 
@@ -278,14 +278,14 @@
 	return(1);
 }
 
-#endif /* USE_INPUT_EVENTS */
+#endif /* SDL_INPUT_LINUXEV */
 
 /* Function to scan the system for joysticks */
 int SDL_SYS_JoystickInit(void)
 {
 	/* The base path of the joystick devices */
 	const char *joydev_pattern[] = {
-#ifdef USE_INPUT_EVENTS
+#if SDL_INPUT_LINUXEV
 		"/dev/input/event%d",
 #endif
 		"/dev/input/js%d",
@@ -345,7 +345,7 @@
 				if ( fd < 0 ) {
 					continue;
 				}
-#ifdef USE_INPUT_EVENTS
+#if SDL_INPUT_LINUXEV
 #ifdef DEBUG_INPUT_EVENTS
 				printf("Checking %s\n", path);
 #endif
@@ -366,7 +366,7 @@
 				break;
 		}
 
-#ifdef USE_INPUT_EVENTS
+#if SDL_INPUT_LINUXEV
 		/* This is a special case...
 		   If the event devices are valid then the joystick devices
 		   will be duplicates but without extra information about their
@@ -400,7 +400,7 @@
 	fd = open(SDL_joylist[index].fname, O_RDONLY, 0);
 	if ( fd >= 0 ) {
 		if ( 
-#ifdef USE_INPUT_EVENTS
+#if SDL_INPUT_LINUXEV
 		     (ioctl(fd, EVIOCGNAME(sizeof(namebuf)), namebuf) <= 0) &&
 #endif
 		     (ioctl(fd, JSIOCGNAME(sizeof(namebuf)), namebuf) <= 0) ) {
@@ -540,7 +540,7 @@
 	return(handled);
 }
 
-#ifdef USE_INPUT_EVENTS
+#if SDL_INPUT_LINUXEV
 
 static SDL_bool EV_ConfigJoystick(SDL_Joystick *joystick, int fd)
 {
@@ -639,7 +639,7 @@
 	return(joystick->hwdata->is_hid);
 }
 
-#endif /* USE_INPUT_EVENTS */
+#endif /* SDL_INPUT_LINUXEV */
 
 #ifndef NO_LOGICAL_JOYSTICKS
 static void ConfigLogicalJoystick(SDL_Joystick *joystick)
@@ -711,7 +711,7 @@
 		ConfigLogicalJoystick(joystick);
 	else
 #endif
-#ifdef USE_INPUT_EVENTS
+#if SDL_INPUT_LINUXEV
 	if ( ! EV_ConfigJoystick(joystick, fd) )
 #endif
 		JS_ConfigJoystick(joystick, fd);
@@ -914,7 +914,7 @@
 		}
 	}
 }
-#ifdef USE_INPUT_EVENTS
+#if SDL_INPUT_LINUXEV
 static __inline__ int EV_AxisCorrect(SDL_Joystick *joystick, int which, int value)
 {
 	struct axis_correct *correct;
@@ -1016,13 +1016,13 @@
 		}
 	}
 }
-#endif /* USE_INPUT_EVENTS */
+#endif /* SDL_INPUT_LINUXEV */
 
 void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
 {
 	int i;
 	
-#ifdef USE_INPUT_EVENTS
+#if SDL_INPUT_LINUXEV
 	if ( joystick->hwdata->is_hid )
 		EV_HandleEvents(joystick);
 	else