Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong preprocessor macro TARGET_OS_MAC #63

Closed

Conversation

crsantos
Copy link

@crsantos crsantos commented Nov 7, 2015

I was noticing that appWillResignActivewas never called so I asked myself why.

Based on this comment on another repo, I guess we need to change those pre-processor macros.

TARGET_OS_IPHONE is a variant of TARGET_OS_MAC so the code won't even run on iOS.
Correct me if I'm wrong.

…TARGET_IPHONE_SIMULATOR)

- TARGET_OS_IPHONE is a variant of TARGET_OS_MAC so the code won't even run on iOS)
@ckrey
Copy link
Contributor

ckrey commented Nov 7, 2015

You are right, this is wrong.
The correct fix is to use #if TARGET_OS_IPHONE == 1

#define MAC IOS IOS SIMULATOR TV TV SIMULATOR WATCH WATCH SIMULATOR
TARGET_OS_MAC 1 1 1 1 1
TARGET_OS_WIN32 0 0 0 0 0
TARGET_OS_UNIX 0 0 0 0 0
TARGET_OS_IPHONE 0 1 1 1 1
TARGET_OS_IOS 0 1 1 0 0
TARGET_OS_WATCH 0 0 0 0 0
TARGET_OS_TV 0 0 0 1 1
TARGET_OS_SIMULATOR 0 0 1 0 1
TARGET_OS_EMBEDDED 0 1 0 1 0

#define TARGET_IPHONE_SIMULATOR TARGET_OS_SIMULATOR // deprecated
#define TARGET_OS_NANO TARGET_OS_WATCH // deprecated

all #defines in TargetConditionals.h

~

@ckrey ckrey closed this in 9aababe Nov 7, 2015
@crsantos
Copy link
Author

crsantos commented Nov 7, 2015

Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants