qxLib
config.h
Go to the documentation of this file.
1 /**
2 
3  @file config.h
4  @author Khrapov
5  @date 25.09.2020
6  @copyright (c) Nick Khrapov, 2021. All right reserved.
7 
8 **/
9 #pragma once
10 
11 #if defined(__clang__) && !defined(__apple_build_version__)
12 _Pragma("GCC diagnostic push");
13 _Pragma("GCC diagnostic ignored \"-Wreserved-identifier\"");
14 _Pragma("GCC diagnostic ignored \"-Wreserved-macro-identifier\"");
15 #endif
16 
17 #include <version>
18 
19 #if defined(__clang__) && !defined(__apple_build_version__)
20 _Pragma("GCC diagnostic pop");
21 #endif
22 
23 //---------------------------------- platform ----------------------------------
24 
25 #if defined(_WIN64) || defined(_WIN32)
26  #define QX_WIN 1
27 #else
28  #define QX_WIN 0
29 #endif
30 
31 #ifdef __APPLE__
32  #define QX_MACOS 1
33 #else
34  #define QX_MACOS 0
35 #endif
36 
37 #ifdef __linux__
38  #define QX_LINUX 1
39 #else
40  #define QX_LINUX 0
41 #endif
42 
43 //---------------------------------- compiler ----------------------------------
44 
45 #if defined(_MSC_VER)
46  #define QX_MSVC_COMPATIBLE 1
47 #else
48  #define QX_MSVC_COMPATIBLE 0
49 #endif
50 
51 #if QX_MSVC_COMPATIBLE && !defined(__clang__) && !defined(__INTEL_COMPILER)
52  #define QX_MSVC 1
53 #else
54  #define QX_MSVC 0
55 #endif
56 
57 #ifdef __GNUG__
58  #define QX_GNU 1
59 #else
60  #define QX_GNU 0
61 #endif
62 
63 #if defined(__clang__) && !defined(__apple_build_version__)
64  #define QX_CLANG 1
65 #else
66  #define QX_CLANG 0
67 #endif
68 
69 #if defined(__clang__) && defined(__apple_build_version__)
70  #define QX_APPLE_CLANG 1
71 #else
72  #define QX_APPLE_CLANG 0
73 #endif
74 
75 //---------------------------------- standard library ----------------------------------
76 
77 #ifdef _LIBCPP_VERSION
78  #define QX_LIBCPP 1
79 #else
80  #define QX_LIBCPP 0
81 #endif
82 
83 #ifdef _MSVC_STL_VERSION
84  #define QX_MSVC_STL 1
85 #else
86  #define QX_MSVC_STL 0
87 #endif
88 
89 #ifdef __GLIBCXX__
90  #define QX_LIBSTDCXX 1
91 #else
92  #define QX_LIBSTDCXX 0
93 #endif
94 
95 //------------------------------------ build -----------------------------------
96 
97 #ifndef QX_DEBUG
98  #ifdef _DEBUG
99  #define QX_DEBUG 1
100  #else
101  #define QX_DEBUG 0
102  #endif
103 #endif
104 
105 #ifndef QX_RELEASE
106  #ifdef _DEBUG
107  #define QX_RELEASE 0
108  #else
109  #define QX_RELEASE 1
110  #endif
111 #endif
112 
113 #ifndef QX_REL_WITH_DEBUG_INFO
114  #define QX_REL_WITH_DEBUG_INFO 0
115 #endif
116 
117 #ifndef QX_MIN_SIZE_RELEASE
118  #define QX_MIN_SIZE_RELEASE 0
119 #endif
120 
121 #define QX_WITH_DEBUG_INFO QX_DEBUG || QX_REL_WITH_DEBUG_INFO