Go to the documentation of this file.
14 # define WS_GCC_FAMILY
23 #if defined(__GNUC__) || defined(__GNUG__)
24 # define WS_GCC_FAMILY
25 # if defined(__clang__)
30 #elif defined(_MSC_VER)
33 # error "Unknown compiler"
40 #if defined(__LP64__) || defined(_WIN64)
51 # define WS_PLATFORM_WINDOWS
52 # define WS_PLATFORM_LINUX
53 # define WS_PLATFORM_MAC
54 # define WS_PLATFORM_IOS
55 # define WS_PLATFORM_EMSCRIPTEN
60 #if defined(_WIN32) || defined(_WIN64)
62 # define NOMINMAX // Already set by CMake, but might be required for consumers
64 # define WS_PLATFORM_WINDOWS
65 #elif defined(__linux__)
66 # define WS_PLATFORM_LINUX
68 # define WS_PLATFORM_MAC
69 # include <TargetConditionals.h>
70 # if defined(TARGET_OS_IOS)
71 # define WS_PLATFORM_IOS
73 #elif defined(__EMSCRIPTEN__)
74 # define WS_PLATFORM_EMSCRIPTEN
76 # error "Unknown platform"
83 #define WS_STRINGIZE(_x) #_x
93 # define WS_PRAGMA_DIAGNOSTIC_PUSH()
94 # define WS_PRAGMA_DIAGNOSTIC_POP()
95 # define WS_PRAGMA_DIAGNOSTIC_IGNORED_GNU(_x)
96 # define WS_PRAGMA_DIAGNOSTIC_IGNORED_GCC(_x)
97 # define WS_PRAGMA_DIAGNOSTIC_IGNORED_CLANG(_x)
98 # define WS_PRAGMA_DIAGNOSTIC_IGNORED_MSC(_x)
100 # if defined(WS_CLANG)
101 # define WS_PRAGMA_DIAGNOSTIC_PUSH() _Pragma("clang diagnostic push")
102 # define WS_PRAGMA_DIAGNOSTIC_POP() _Pragma("clang diagnostic pop")
103 # define WS_PRAGMA_DIAGNOSTIC_IGNORED_CLANG(_x) _Pragma(WS_STRINGIZE(clang diagnostic ignored _x))
104 # define WS_PRAGMA_DIAGNOSTIC_IGNORED_GNU(_x) WS_PRAGMA_DIAGNOSTIC_IGNORED_CLANG(_x)
106 # define WS_PRAGMA_DIAGNOSTIC_IGNORED_CLANG(_x)
109 # define WS_PRAGMA_DIAGNOSTIC_PUSH() _Pragma("GCC diagnostic push")
110 # define WS_PRAGMA_DIAGNOSTIC_POP() _Pragma("GCC diagnostic pop")
111 # define WS_PRAGMA_DIAGNOSTIC_IGNORED_GCC(_x) _Pragma(WS_STRINGIZE(GCC diagnostic ignored _x) )
112 # define WS_PRAGMA_DIAGNOSTIC_IGNORED_GNU(_x) WS_PRAGMA_DIAGNOSTIC_IGNORED_GCC(_x)
114 # define WS_PRAGMA_DIAGNOSTIC_IGNORED_GCC(_x)
117 # define WS_PRAGMA_DIAGNOSTIC_PUSH() __pragma(warning(push) )
118 # define WS_PRAGMA_DIAGNOSTIC_POP() __pragma(warning(pop) )
119 # define WS_PRAGMA_DIAGNOSTIC_IGNORED_MSC(_x) __pragma(warning(disable:_x) )
120 # define WS_PRAGMA_DIAGNOSTIC_IGNORED_GNU(_x)
122 # define WS_PRAGMA_DIAGNOSTIC_IGNORED_MSC(_x)
145 #if __cplusplus >= 201703 || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703)
146 # define WS_FALLTHROUGH [[fallthrough]]
147 #elif defined(WS_CLANG)
148 # if __cplusplus >= 201103L && defined(__has_warning)
149 # if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
150 # define WS_FALLTHROUGH [[clang::fallthrough]]
153 #elif defined(WS_GCC) && __GNUC__ >= 7
154 # define WS_FALLTHROUGH __attribute__((fallthrough))
156 #ifndef WS_FALLTHROUGH
157 # define WS_FALLTHROUGH ((void)0)
169 constexpr
size_t operator"" _z(
unsigned long long int n) {
return size_t(n); }