Debian Codegraph @

src/platform/platform.hpp

raw
1 #ifndef PLATFORM_HPP
2 #define PLATFORM_HPP
3
4 #define IS_WINDOWS 0
5 #define IS_LINUX 0
6 #define IS_APPLE 0
7
8 #if defined(_WIN32)
9 #undef IS_WINDOWS
10 #define IS_WINDOWS 1
11 #elif defined(__linux)
12 #undef IS_LINUX
13 #define IS_LINUX 1
14 #elif defined(__APPLE__)
15 #undef IS_APPLE
16 #define IS_APPLE 1
17 #else
18 #error "Unexpected platform"
19 #endif
20
21 #define IS_CLANG 0
22 #define IS_GCC 0
23 #define IS_MSVC 0
24
25 #if defined(__clang__)
26 #undef IS_CLANG
27 #define IS_CLANG 1
28 #elif defined(__GNUC__) || defined(__GNUG__)
29 #undef IS_GCC
30 #define IS_GCC 1
31 #elif defined(_MSC_VER)
32 #undef IS_MSVC
33 #define IS_MSVC 1
34 #else
35 #error "Unsupported compiler"
36 #endif
37
38 #define IS_LIBSTDCXX 0
39 #define IS_LIBCXX 0
40 #if defined(__GLIBCXX__) || defined(__GLIBCPP__)
41 #undef IS_LIBSTDCXX
42 #define IS_LIBSTDCXX 1
43 #elif defined(_LIBCPP_VERSION)
44 #undef IS_LIBCXX
45 #define IS_LIBCXX 1
46 #endif
47
48 #endif