-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompiler.hpp
More file actions
51 lines (44 loc) · 1.19 KB
/
Copy pathcompiler.hpp
File metadata and controls
51 lines (44 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* File: /lib/debug/compiler.hpp
*
* This file is a part of cpplib project which is distributed under MIT License.
* See file LICENSE for full license details.
*
* Copyright (c) 2020-present Nikita Zuev (V.Slavski!) <[email protected]>
*/
#ifndef CPPLIB__lib__debug__compiler__hpp
#define CPPLIB__lib__debug__compiler__hpp
#include "../../lib/utils/enum.hpp"
namespace lib::debug {
LIB_UTILS_ENUM( Compiler
, CLANG
, MINGW
, GCC
, MSVC
, UNKNOWN
)
#if defined(__clang__)
#define CPPLIB_COMPILER_CLANG
static constexpr auto compiler = Compiler::CLANG;
#elif defined(__MINGW32__) // || __MINGW64__
#define CPPLIB_COMPILER_MINGW
static constexpr auto compiler = Compiler::MINGW;
#elif defined(__GNUC__)
#define CPPLIB_COMPILER_GCC
static constexpr auto compiler = Compiler::GCC;
#elif defined(_MSC_VER)
#define CPPLIB_COMPILER_MSVC
static constexpr auto compiler = Compiler::MSVC;
#else
#define CPPLIB_COMPILER_UNKNOWN
static constexpr auto compiler = Compiler::UNKNOWN;
#warning "Unknown compiler"
#endif // ...compiler...
} // namespace lib::debug
LIB_UTILS_ENUM_NAMES( lib::debug::Compiler
, "CLANG"
, "MINGW"
, "GCC"
, "MSVC"
, "UNKNOWN"
)
#endif // CPPLIB__lib__debug__compiler__hpp