Skip to content

Commit

Permalink
Mac: Fix compiler warning when building with a min target >= 10.6.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed May 26, 2015
1 parent 37f4eb5 commit d1980b9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/joystick/darwin/SDL_sysjoystick.c
Expand Up @@ -436,15 +436,22 @@ 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)) {
device->ffservice = ioservice;
MacHaptic_MaybeAddDevice(ioservice);
}
#endif

#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
}
#endif

/* Add device to the end of the list */
if ( !gpDeviceList ) {
Expand Down

0 comments on commit d1980b9

Please sign in to comment.