ORIGINAL
Loading...
Searching...
No Matches
config.h
Go to the documentation of this file.
1#ifndef CONFIG_H
2#define CONFIG_H
3
12#include <cstdint>
13
20#if defined(_WIN32) || defined(_WIN64)
21#define ORIGINAL_PLATFORM_WINDOWS 1
22#ifdef _WIN64
23#define ORIGINAL_PLATFORM_WINDOWS_64 1
24#elif
25#define ORIGINAL_PLATFORM_WINDOWS_32 1
26#else
27 #define ORIGINAL_PLATFORM_WINDOWS 0
28#endif
29#elif defined(__linux__)
30#define ORIGINAL_PLATFORM_LINUX 1
31#elif defined(__APPLE__) && defined(__MACH__)
32 #define ORIGINAL_PLATFORM_MACOS 1
33#elif defined(__unix__)
34 #define ORIGINAL_PLATFORM_UNIX 1
35#else
36 #define ORIGINAL_PLATFORM_UNKNOWN 1
37#endif
// end of PlatformDetection group
39
45#if defined(__clang__)
46#define ORIGINAL_COMPILER_CLANG 1
47 #define ORIGINAL_COMPILER_VERSION __clang_major__.__clang_minor__.__clang_patchlevel__
48#elif defined(__GNUC__) || defined(__GNUG__)
49#define ORIGINAL_COMPILER_GCC 1
50#define ORIGINAL_COMPILER_VERSION __GNUC__.__GNUC_MINOR__.__GNUC_PATCHLEVEL__
51#elif defined(_MSC_VER)
52#define ORIGINAL_COMPILER_MSVC 1
53 #define ORIGINAL_COMPILER_VERSION _MSC_VER
54#else
55 #define ORIGINAL_COMPILER_UNKNOWN 1
56#endif
// end of CompilerDetection group
58
66namespace original {
67
79 consteval bool ON_WINDOWS(){
80 #if ORIGINAL_PLATFORM_WINDOWS
81 return true;
82 #else
83 return false;
84 #endif
85 }
86
92 consteval bool ON_WIN32(){
93 #if ORIGINAL_PLATFORM_WINDOWS_32
94 return true;
95 #else
96 return false;
97 #endif
98 }
99
105 consteval bool ON_WIN64(){
106 #if ORIGINAL_PLATFORM_WINDOWS_64
107 return true;
108 #else
109 return false;
110 #endif
111 }
112
118 consteval bool ON_LINUX(){
119 #if ORIGINAL_PLATFORM_LINUX
120 return true;
121 #else
122 return false;
123 #endif
124 }
125
131 consteval bool ON_MACOS(){
132 #if ORIGINAL_PLATFORM_MACOS
133 return true;
134 #else
135 return false;
136 #endif
137 }
138
144 consteval bool ON_UNIX(){
145 #if ORIGINAL_PLATFORM_UNIX
146 return true;
147 #else
148 return false;
149 #endif
150 }
151
157 consteval bool ON_UNKNOWN_PLATFORM(){
158 #if ORIGINAL_PLATFORM_UNKNOWN
159 return true;
160 #else
161 return false;
162 #endif
163 }
// end of PlatformDetectionFunctions group
165
177 consteval bool USING_CLANG(){
178 #if ORIGINAL_COMPILER_CLANG
179 return true;
180 #else
181 return false;
182 #endif
183 }
184
190 consteval bool USING_GCC(){
191 #if ORIGINAL_COMPILER_GCC
192 return true;
193 #else
194 return false;
195 #endif
196 }
197
203 consteval bool USING_MSVC(){
204 #if ORIGINAL_COMPILER_MSVC
205 return true;
206 #else
207 return false;
208 #endif
209 }
210
216 consteval bool USING_UNKNOWN_COMPLIER(){
217 #if ORIGINAL_COMPILER_UNKNOWN
218 return true;
219 #else
220 return false;
221 #endif
222 }
// end of CompilerDetectionFunctions group
224
237 using byte = std::uint8_t;
238
245 using s_byte = std::int8_t;
246
254 using integer = std::int64_t;
255
263 using u_integer = std::uint32_t;
264
274 using ul_integer = std::uint64_t;
275
284
292 using l_floating = long double;
// end of TypeDefinitions group
294}
295
296#endif //CONFIG_H
Unique ownership smart pointer with move semantics.
Definition ownerPtr.h:37
consteval bool USING_UNKNOWN_COMPLIER()
Checks if compiling with unknown compiler.
Definition config.h:216
consteval bool USING_MSVC()
Checks if compiling with MSVC.
Definition config.h:203
consteval bool USING_GCC()
Checks if compiling with GCC.
Definition config.h:190
consteval bool USING_CLANG()
Checks if compiling with Clang.
Definition config.h:177
consteval bool ON_LINUX()
Checks if compiling for Linux platform.
Definition config.h:118
consteval bool ON_WINDOWS()
Checks if compiling for Windows platform.
Definition config.h:79
consteval bool ON_UNIX()
Checks if compiling for Unix-like platform (excluding Linux/macOS)
Definition config.h:144
consteval bool ON_WIN32()
Checks if compiling for 32-bit Windows.
Definition config.h:92
consteval bool ON_UNKNOWN_PLATFORM()
Checks if compiling for unknown platform.
Definition config.h:157
consteval bool ON_WIN64()
Checks if compiling for 64-bit Windows.
Definition config.h:105
consteval bool ON_MACOS()
Checks if compiling for macOS platform.
Definition config.h:131
std::uint32_t u_integer
32-bit unsigned integer type for sizes and indexes
Definition config.h:263
std::int8_t s_byte
Signed 8-bit integer type.
Definition config.h:245
std::uint8_t byte
Unsigned 8-bit integer type (byte)
Definition config.h:237
std::uint64_t ul_integer
64-bit unsigned integer type
Definition config.h:274
std::int64_t integer
64-bit signed integer type for arithmetic operations
Definition config.h:254
double floating
Double-precision floating-point type.
Definition config.h:283
Main namespace for the project Original.
Definition algorithms.h:21