From 03f8528315fa46c95991a34f3325d7b33ae5538c Mon Sep 17 00:00:00 2001
From: Edward Rudd <urkle@outoforder.cc>
Date: Sat, 02 May 2020 21:48:36 +0000
Subject: [PATCH] Update source to SDL2 2.0.12

---
 source/src/haptic/darwin/SDL_syshaptic.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/source/src/haptic/darwin/SDL_syshaptic.c b/source/src/haptic/darwin/SDL_syshaptic.c
index 67cb9f5..ecbd2bd 100644
--- a/source/src/haptic/darwin/SDL_syshaptic.c
+++ b/source/src/haptic/darwin/SDL_syshaptic.c
@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -599,6 +599,9 @@
 int
 SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick)
 {
+    if (joystick->driver != &SDL_DARWIN_JoystickDriver) {
+        return SDL_FALSE;
+    }
     if (joystick->hwdata->ffservice != 0) {
         return SDL_TRUE;
     }
@@ -612,6 +615,9 @@
 int
 SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick)
 {
+    if (joystick->driver != &SDL_DARWIN_JoystickDriver) {
+        return 0;
+    }
     if (IOObjectIsEqualTo((io_object_t) ((size_t)haptic->hwdata->device),
                           joystick->hwdata->ffservice)) {
         return 1;
@@ -628,7 +634,10 @@
 {
     int device_index = 0;
     SDL_hapticlist_item *item;
-
+    
+    if (joystick->driver != &SDL_DARWIN_JoystickDriver) {
+        return -1;
+    }
     for (item = SDL_hapticlist; item; item = item->next) {
         if (IOObjectIsEqualTo((io_object_t) item->dev,
                              joystick->hwdata->ffservice)) {

--
Gitblit v1.9.3