Do not use UDEV references in EVDEV if UDEV has not been detected
authorGabriel Jacobo <gabomdq@gmail.com>
Sat, 28 Sep 2013 15:48:32 -0300
changeset 7755 f06772125578
parent 7754 2f67f0616044
child 7756 f45660a4974c
Do not use UDEV references in EVDEV if UDEV has not been detected
src/input/evdev/SDL_evdev.c
--- a/src/input/evdev/SDL_evdev.c	Sat Sep 28 10:30:51 2013 -0700
+++ b/src/input/evdev/SDL_evdev.c	Sat Sep 28 15:48:32 2013 -0300
@@ -53,12 +53,14 @@
 #define SYN_DROPPED 3
 #endif
 
+static SDL_Scancode SDL_EVDEV_translate_keycode(int keycode);
+static void SDL_EVDEV_sync_device(SDL_evdevlist_item *item);
 
+#if SDL_USE_LIBUDEV
 static int SDL_EVDEV_device_removed(const char *devpath);
 static int SDL_EVDEV_device_added(const SDL_UDEV_deviceclass devclass, const char *devpath);
-static SDL_Scancode SDL_EVDEV_translate_keycode(int keycode);
-static void SDL_EVDEV_sync_device(SDL_evdevlist_item *item);
 void SDL_EVDEV_udev_callback(SDL_UDEV_deviceevent udev_type, SDL_UDEV_deviceclass udev_class, const char *devpath);
+#endif /* SDL_USE_LIBUDEV */
 
 static SDL_Scancode EVDEV_Keycodes[] = {
     SDL_SCANCODE_UNKNOWN,       /*  KEY_RESERVED        0 */
@@ -390,6 +392,7 @@
     }
 }
 
+#if SDL_USE_LIBUDEV
 void SDL_EVDEV_udev_callback(SDL_UDEV_deviceevent udev_type, SDL_UDEV_deviceclass udev_class, const char *devpath)
 {
     SDL_EVDEV_deviceclass devclass;
@@ -429,6 +432,8 @@
     
 }
 
+#endif /* SDL_USE_LIBUDEV */
+
 void 
 SDL_EVDEV_Poll(void)
 {
@@ -562,6 +567,7 @@
     /* TODO: get full state of device and report whatever is required */
 }
 
+#if SDL_USE_LIBUDEV
 static int
 SDL_EVDEV_device_added(const SDL_UDEV_deviceclass devclass, const char *devpath)
 {
@@ -640,6 +646,7 @@
 
     return -1;
 }
+#endif /* SDL_USE_LIBUDEV */
 
 #endif /* SDL_INPUT_LINUXEV */