Skip to content

Commit

Permalink
Fixed build when using an older Xcode SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jan 22, 2025
1 parent df3cfbc commit 64f8d6a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/joystick/apple/SDL_mfijoystick.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@

#include <objc/message.h>

/* remove compilation warnings for strict builds by defining these selectors, even though
* they are only ever used indirectly through objc_msgSend
*/
// Fix build errors when using an older SDK by defining these selectors
@interface GCController (SDL)
#if !((__IPHONE_OS_VERSION_MAX_ALLOWED >= 140500) || (__APPLETV_OS_VERSION_MAX_ALLOWED >= 140500) || (__MAC_OS_X_VERSION_MAX_ALLOWED >= 110300))
@property(class, nonatomic, readwrite) BOOL shouldMonitorBackgroundEvents;
Expand Down
17 changes: 17 additions & 0 deletions src/video/uikit/SDL_uikitpen.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@

#include "../../events/SDL_pen_c.h"

#if !defined(SDL_PLATFORM_TVOS)
// Fix build errors when using an older SDK by defining these selectors
@interface UIHoverGestureRecognizer (SDL)
#if !(__IPHONE_OS_VERSION_MAX_ALLOWED >= 160100)
@property (nonatomic, readonly) CGFloat zOffset;
#endif
#if !(__IPHONE_OS_VERSION_MAX_ALLOWED >= 160400)
- (CGFloat) azimuthAngleInView:(UIView *) view;

@property (nonatomic, readonly) CGFloat altitudeAngle;
#endif
#if !(__IPHONE_OS_VERSION_MAX_ALLOWED >= 170500)
@property (nonatomic, readonly) CGFloat rollAngle;
#endif
@end
#endif // !SDL_PLATFORM_TVOS

static SDL_PenID apple_pencil_id = 0;

bool UIKit_InitPen(SDL_VideoDevice *_this)
Expand Down

0 comments on commit 64f8d6a

Please sign in to comment.