mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-03 22:07:07 +08:00
Fixed building on Mac OS X on the command line and with an older macOS SDK
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -25394,7 +25394,12 @@ $as_echo "#define SDL_AUDIO_DRIVER_COREAUDIO 1" >>confdefs.h
|
||||
|
||||
$as_echo "#define SDL_JOYSTICK_IOKIT 1" >>confdefs.h
|
||||
|
||||
|
||||
$as_echo "#define SDL_JOYSTICK_MFI 1" >>confdefs.h
|
||||
|
||||
SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
|
||||
SOURCES="$SOURCES $srcdir/src/joystick/iphoneos/*.m"
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-weak_framework,CoreHaptics -Wl,-weak_framework,GameController"
|
||||
have_joystick=yes
|
||||
fi
|
||||
# Set up files for the haptic library
|
||||
|
||||
@@ -4053,7 +4053,10 @@ AS_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau
|
||||
# Set up files for the joystick library
|
||||
if test x$enable_joystick = xyes; then
|
||||
AC_DEFINE(SDL_JOYSTICK_IOKIT, 1, [ ])
|
||||
AC_DEFINE(SDL_JOYSTICK_MFI, 1, [ ])
|
||||
SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
|
||||
SOURCES="$SOURCES $srcdir/src/joystick/iphoneos/*.m"
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-weak_framework,CoreHaptics -Wl,-weak_framework,GameController"
|
||||
have_joystick=yes
|
||||
fi
|
||||
# Set up files for the haptic library
|
||||
|
||||
@@ -289,6 +289,7 @@
|
||||
#undef SDL_JOYSTICK_XINPUT
|
||||
#undef SDL_JOYSTICK_DUMMY
|
||||
#undef SDL_JOYSTICK_IOKIT
|
||||
#undef SDL_JOYSTICK_MFI
|
||||
#undef SDL_JOYSTICK_LINUX
|
||||
#undef SDL_JOYSTICK_ANDROID
|
||||
#undef SDL_JOYSTICK_WINMM
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "../SDL_syshaptic.h"
|
||||
#include "SDL_joystick.h"
|
||||
#include "../../joystick/SDL_sysjoystick.h" /* For the real SDL_Joystick */
|
||||
#include "../../joystick/darwin/SDL_sysjoystick_c.h" /* For joystick hwdata */
|
||||
#include "../../joystick/darwin/SDL_iokitjoystick_c.h" /* For joystick hwdata */
|
||||
#include "SDL_syshaptic_c.h"
|
||||
|
||||
#include <IOKit/IOKitLib.h>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "SDL_joystick.h"
|
||||
#include "../SDL_sysjoystick.h"
|
||||
#include "../SDL_joystick_c.h"
|
||||
#include "SDL_sysjoystick_c.h"
|
||||
#include "SDL_iokitjoystick_c.h"
|
||||
#include "../hidapi/SDL_hidapijoystick_c.h"
|
||||
#include "../../haptic/darwin/SDL_syshaptic_c.h" /* For haptic hot plugging */
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "../../SDL_internal.h"
|
||||
|
||||
/* This is the iOS implementation of the SDL joystick API */
|
||||
#include "SDL_sysjoystick_c.h"
|
||||
#include "SDL_mfijoystick_c.h"
|
||||
|
||||
#if !TARGET_OS_OSX
|
||||
/* needed for SDL_IPHONE_MAX_GFORCE macro */
|
||||
@@ -46,6 +46,10 @@
|
||||
#import <CoreMotion/CoreMotion.h>
|
||||
#endif
|
||||
|
||||
#if TARGET_OS_OSX
|
||||
#include <IOKit/hid/IOHIDManager.h>
|
||||
#endif
|
||||
|
||||
#ifdef SDL_JOYSTICK_MFI
|
||||
#import <GameController/GameController.h>
|
||||
|
||||
@@ -58,6 +62,11 @@ static id disconnectObserver = nil;
|
||||
/* remove compilation warnings for strict builds by defining these selectors, even though
|
||||
* they are only ever used indirectly through objc_msgSend
|
||||
*/
|
||||
@interface GCController (SDL)
|
||||
#if TARGET_OS_OSX && (__MAC_OS_X_VERSION_MAX_ALLOWED <= 101600)
|
||||
+ (BOOL)supportsHIDDevice:(IOHIDDeviceRef)device;
|
||||
#endif
|
||||
@end
|
||||
@interface GCExtendedGamepad (SDL)
|
||||
#if !((__IPHONE_OS_VERSION_MAX_ALLOWED >= 121000) || (__APPLETV_OS_VERSION_MAX_ALLOWED >= 121000) || (__MAC_OS_VERSION_MAX_ALLOWED >= 1401000))
|
||||
@property (nonatomic, readonly, nullable) GCControllerButtonInput *leftThumbstickButton;
|
||||
Reference in New Issue
Block a user