When development various platforms(Android,iPhone,Mac,Windows and so on), it is necessary diverged processing(#ifdef/#endif) by depends on an platform definition.
But, I don’t know original definition in Mac/iPhone/Android.
Windows : WIN32 (Visual C++)
Mac : __MAC_NA(?) (XCode)
iPhone/iPad/iPod : __IPHONE_NA(?) (XCode)
Android : ?? (AndroidNDK)
By what definition should I divide?
You could always make some up for your projects, thereby freeing yourself from compiler/platform specific defines
.
- Android:
#define PLATFORM_ANDROID
- Iphone:
#define PLATFORM_IPHONE
- etc.
And have all builds include a configuration file that defines one of these macros in a given project and that should work across the board. If you’re using Visual Studio, you can just define these in the Project Settings without even needing a configuration file.