Mac: Fix compiler warning when building with a min target >= 10.6.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 26 May 2015 12:52:28 -0400
changeset 9632 6ae6b0b46e78
parent 9631 e015da7884df
child 9633 3e742dd2c13d
Mac: Fix compiler warning when building with a min target >= 10.6.
src/joystick/darwin/SDL_sysjoystick.c
--- a/src/joystick/darwin/SDL_sysjoystick.c	Tue May 26 12:47:03 2015 -0400
+++ b/src/joystick/darwin/SDL_sysjoystick.c	Tue May 26 12:52:28 2015 -0400
@@ -436,7 +436,11 @@
     device->instance_id = ++s_joystick_instance_id;
 
     /* We have to do some storage of the io_service_t for SDL_HapticOpenFromJoystick */
+
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
     if (IOHIDDeviceGetService != NULL) {  /* weak reference: available in 10.6 and later. */
+#endif
+
         const io_service_t ioservice = IOHIDDeviceGetService(ioHIDDeviceObject);
 #if SDL_HAPTIC_IOKIT
         if ((ioservice) && (FFIsForceFeedback(ioservice) == FF_OK)) {
@@ -444,7 +448,10 @@
             MacHaptic_MaybeAddDevice(ioservice);
         }
 #endif
+
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
     }
+#endif
 
     /* Add device to the end of the list */
     if ( !gpDeviceList ) {