preprocessor macros for iOS

This commit is contained in:
Eric Betts 2022-01-27 16:46:49 -08:00
parent f1501c9698
commit 8b21655458
2 changed files with 18 additions and 1 deletions

View file

@ -8,6 +8,15 @@
#ifndef lconfig_h
#define lconfig_h
#if defined(__APPLE__)
#include "TargetConditionals.h"
#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV
#define system(s) ((s)==NULL ? 0 : -1)
#endif // end iOS
#elif defined(__ANDROID__)
#define system(s) ((s)==NULL ? 0 : -1)
#endif
#include <limits.h>
#include <stddef.h>

View file

@ -20,7 +20,12 @@
#import <Foundation/NSString.h>
#import <Foundation/NSProcessInfo.h>
#if TARGET_OS_IOS
#import <UIKit/UIKit.h>
#else
#import <AppKit/NSApplication.h>
#endif
static id activity = nil;
@ -49,8 +54,11 @@ void enableAppNap() { }
#endif
#if TARGET_OS_IOS
void makeUnfocusable() { }
void makeFocusable() { }
//OS X Version 10.6 is defined in OS X 10.6 and later
#if defined(MAC_OS_X_VERSION_10_6)
#elif defined(MAC_OS_X_VERSION_10_6)
void makeUnfocusable() {
[NSApp setActivationPolicy:NSApplicationActivationPolicyProhibited];
}