TazGraph Project v0.1.0
Loading...
Searching...
No Matches
PlatformDetection.h
1// Platform detection using predefined macros
2#ifdef _WIN32
3 /* Windows x64/x86 */
4#ifdef _WIN64
5 /* Windows x64 */
6#define TAZ_PLATFORM_WINDOWS
7#else
8 /* Windows x86 */
9#error "x86 Builds are not supported!"
10#endif
11#elif defined(__APPLE__) || defined(__MACH__)
12#include <TargetConditionals.h>
13/* TARGET_OS_MAC exists on all the platforms
14 * so we must check all of them (in this order)
15 * to ensure that we're running on MAC
16 * and not some other Apple platform */
17#if TARGET_IPHONE_SIMULATOR == 1
18#error "IOS simulator is not supported!"
19#elif TARGET_OS_IPHONE == 1
20#define TAZ_PLATFORM_IOS
21#error "IOS is not supported!"
22#elif TARGET_OS_MAC == 1
23#define TAZ_PLATFORM_MACOS
24#error "MacOS is not supported!"
25#else
26#error "Unknown Apple platform!"
27#endif
28 /* We also have to check __ANDROID__ before __linux__
29 * since android is based on the linux kernel
30 * it has __linux__ defined */
31#elif defined(__ANDROID__)
32#define TAZ_PLATFORM_ANDROID
33#error "Android is not supported!"
34#elif defined(__linux__)
35#define TAZ_PLATFORM_LINUX
36#else
37 /* Unknown compiler/platform */
38#error "Unknown platform!"
39#endif // End of platform detection