Support Class Library
A set of tools providing classes and utility
apple.h
Go to the documentation of this file.
1 #pragma once
2 
7 #if defined(__APPLE__) && __APPLE__
8  #define SCL_PLATFORM_APPLE true
9  #include "TargetConditionals.h"
10 
15  #if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR
16  #define SCL_PLATFORM_IOS_SIMULATOR true
17  #else
18  #define SCL_PLATFORM_IOS_SIMULATOR false
19  #endif
20 
25  #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
26  #define SCL_PLATFORM_IOS (!SCL_PLATFORM_IOS_SIMULATOR)
27  #else
28  #define SCL_PLATFORM_IOS false
29  #endif
30 
35  #if defined(TARGET_OS_MAC) && TARGET_OS_MAC
36  #define SCL_PLATFORM_OSX (!SCL_PLATFORM_IOS)
37  #else
38  #define SCL_PLATFORM_OSX false
39  #endif
40 #else
41  #define SCL_PLATFORM_APPLE false
42  #define SCL_PLATFORM_IOS_SIMULATOR false
43  #define SCL_PLATFORM_IOS false
44  #define SCL_PLATFORM_OSX false
45 #endif
46 
51 #define SCL_PLATFORM_MAC SCL_PLATFORM_OSX
52 
57 #define SCL_PLATFORM_IPHONE SCL_PLATFORM_IOS
58 
59 namespace scl{
60  namespace detect{
61  namespace platform{
63  constexpr bool ios = SCL_PLATFORM_IOS;
64  constexpr bool osx = SCL_PLATFORM_OSX;
65 
66  constexpr bool apple = SCL_PLATFORM_APPLE;
67  constexpr bool mac = SCL_PLATFORM_MAC;
68  constexpr bool iphone = SCL_PLATFORM_IPHONE;
69  }
70  }
71 }
constexpr bool ios
Definition: apple.h:63
#define SCL_PLATFORM_IOS
Definition: apple.h:43
Global namespace of the SCL.
Definition: alias.hpp:3
constexpr bool iphone
Definition: apple.h:68
constexpr bool iosSimulator
Definition: apple.h:62
#define SCL_PLATFORM_APPLE
Macro that detects whether or not the platform is by Apple.
Definition: apple.h:41
constexpr bool mac
Definition: apple.h:67
#define SCL_PLATFORM_MAC
Macro that detects whether or not the platform is a Mac.
constexpr bool osx
Definition: apple.h:64
#define SCL_PLATFORM_OSX
Definition: apple.h:44
constexpr bool apple
Definition: apple.h:66
#define SCL_PLATFORM_IOS_SIMULATOR
Definition: apple.h:42
#define SCL_PLATFORM_IPHONE
Definition: apple.h:57