Get rid of messy IS_IOS_VERSION macros

This commit is contained in:
Twinaphex 2015-02-25 00:09:36 +01:00
parent 3bfa6e4ff0
commit 91fe5c52b4
4 changed files with 5 additions and 9 deletions

View File

@ -22,7 +22,7 @@
static BOOL apple_gamecontroller_available(void)
{
if (IOS_IS_VERSION_6_OR_LOWER())
if (get_ios_version_major() <= 6)
return false;
/* by checking for extern symbols defined by the framework, we can check for its
* existence at runtime. This is the Apple endorsed way of dealing with this */

View File

@ -326,8 +326,8 @@ static void file_action(enum file_action action, NSString* source, NSString* tar
{
bool is_zip;
UIActionSheet *menu;
NSString *button4_name = (IOS_IS_VERSION_7_OR_HIGHER()) ? @"AirDrop" : @"Delete";
NSString *button5_name = (IOS_IS_VERSION_7_OR_HIGHER()) ? @"Delete" : nil;
NSString *button4_name = (get_ios_version_major() >= 7) ? @"AirDrop" : @"Delete";
NSString *button5_name = (get_ios_version_major() >= 7) ? @"Delete" : nil;
self.selectedItem = [self itemForIndexPath:idx_path];
is_zip = !(strcmp(self.selectedItem.path.pathExtension.UTF8String, "zip"));
@ -367,7 +367,7 @@ static void file_action(enum file_action action, NSString* source, NSString* tar
[alertView show];
}
#ifdef __IPHONE_7_0
else if (!strcmp(action.UTF8String, "AirDrop") && IOS_IS_VERSION_7_OR_HIGHER())
else if (!strcmp(action.UTF8String, "AirDrop") && (get_ios_version_major() >= 7))
{
// TODO: Zip if not already zipped

View File

@ -50,10 +50,6 @@ const void* apple_get_frontend_settings(void);
- (void)refreshSystemConfig;
@end
// modes are: keyboard, icade and btstack
int get_ios_version_major(void);
#define IOS_IS_VERSION_7_OR_HIGHER() ((get_ios_version_major() >= 7))
#define IOS_IS_VERSION_6_OR_LOWER() ((get_ios_version_major() <= 6))
#endif

View File

@ -205,7 +205,7 @@ enum
if (event.allTouches.count)
handle_touch_event(event.allTouches.allObjects);
if (!(IOS_IS_VERSION_7_OR_HIGHER()) && [event respondsToSelector:@selector(_gsEvent)])
if (!(get_ios_version_major() >= 7) && [event respondsToSelector:@selector(_gsEvent)])
{
// Stolen from: http://nacho4d-nacho4d.blogspot.com/2012/01/catching-keyboard-events-in-ios.html
const uint8_t* eventMem = objc_unretainedPointer([event performSelector:@selector(_gsEvent)]);