(iOS) Add IOS_IS_VERSION_6_OR_LOWER() macro

This commit is contained in:
twinaphex 2013-12-30 17:35:18 +01:00
parent 4acd75155f
commit 255c3dcbd4
2 changed files with 6 additions and 9 deletions

View File

@ -26,14 +26,10 @@
#import <GameController/GameController.h>
#include "apple_input.h"
#ifdef IOS
#endif
static void apple_gamecontroller_poll(GCController* controller)
{
#ifdef IOS
if (!(IOS_IS_VERSION_7_OR_HIGHER()))
if (IOS_IS_VERSION_6_OR_LOWER())
return;
#endif
if (!controller || controller.playerIndex == MAX_PLAYERS)
@ -83,7 +79,7 @@ static void apple_gamecontroller_poll(GCController* controller)
void apple_gamecontroller_poll_all(void)
{
#ifdef IOS
if (!(IOS_IS_VERSION_7_OR_HIGHER()))
if (IOS_IS_VERSION_6_OR_LOWER())
return;
#endif
NSArray* controllers = [GCController controllers];
@ -95,7 +91,7 @@ void apple_gamecontroller_poll_all(void)
void apple_gamecontroller_connect(GCController* controller)
{
#ifdef IOS
if (!(IOS_IS_VERSION_7_OR_HIGHER()))
if (IOS_IS_VERSION_6_OR_LOWER())
return;
#endif
int32_t slot = apple_joypad_connect_gcapi();
@ -116,7 +112,7 @@ void apple_gamecontroller_connect(GCController* controller)
void apple_gamecontroller_disconnect(GCController* controller)
{
#ifdef IOS
if (!(IOS_IS_VERSION_7_OR_HIGHER()))
if (IOS_IS_VERSION_6_OR_LOWER())
return;
#endif
if (controller.playerIndex == GCControllerPlayerIndexUnset)
@ -128,7 +124,7 @@ void apple_gamecontroller_disconnect(GCController* controller)
void apple_gamecontroller_init(void)
{
#ifdef IOS
if (!(IOS_IS_VERSION_7_OR_HIGHER()))
if (IOS_IS_VERSION_6_OR_LOWER())
return;
#endif

View File

@ -74,5 +74,6 @@ void ios_set_bluetooth_mode(NSString* mode);
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