Commit d1980b93fbc6a7ea27e4f6b36bca750ceb3e609f

Ryan C. Gordon 2015-05-26T12:52:28

Mac: Fix compiler warning when building with a min target >= 10.6.

diff --git a/src/joystick/darwin/SDL_sysjoystick.c b/src/joystick/darwin/SDL_sysjoystick.c
index f46035d..2b5f591 100644
--- a/src/joystick/darwin/SDL_sysjoystick.c
+++ b/src/joystick/darwin/SDL_sysjoystick.c
@@ -436,7 +436,11 @@ JoystickDeviceWasAddedCallback(void *ctx, IOReturn res, void *sender, IOHIDDevic
     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 @@ JoystickDeviceWasAddedCallback(void *ctx, IOReturn res, void *sender, IOHIDDevic
             MacHaptic_MaybeAddDevice(ioservice);
         }
 #endif
+
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
     }
+#endif
 
     /* Add device to the end of the list */
     if ( !gpDeviceList ) {