repr
0.1
Reconstructable string representations and more
Loading...
Searching...
No Matches
platform.h
Go to the documentation of this file.
1
#pragma once
2
#include <
librepr/feature.h
>
3
4
namespace
librepr
{
5
6
enum class
Platform
:
unsigned
{
Unknown
,
Linux
,
UNIX
,
Windows
,
macOS
};
7
enum class
Compiler
:
unsigned
{
Unknown
,
Clang
,
GCC
,
MSVC
};
8
9
#if defined(_WIN32)
10
#define LIBREPR_PLATFORM_WINDOWS ON
11
constexpr
inline
auto
platform
=
Platform::Windows
;
12
13
#elif defined(__linux__)
14
#define LIBREPR_PLATFORM_LINUX ON
15
constexpr
inline
auto
platform
=
Platform::Linux
;
16
17
#elif defined(__APPLE__)
18
#define LIBREPR_PLATFORM_MACOS ON
19
constexpr
inline
auto
platform
=
Platform::macOS
;
20
21
#elif defined(unix) || defined(__unix__) || defined(__unix)
22
#define LIBREPR_PLATFORM_UNIX ON
23
constexpr
inline
auto
platform
=
Platform::UNIX
;
24
25
#else
26
#warning "Unsupported platform"
27
constexpr
inline
auto
compiler
=
Platform::Unknown
;
28
#endif
29
30
#if !defined(LIBREPR_PLATFORM_WINDOWS)
31
# define LIBREPR_PLATFORM_WINDOWS OFF
32
#endif
33
34
#if !defined(LIBREPR_PLATFORM_LINUX)
35
# define LIBREPR_PLATFORM_LINUX OFF
36
#endif
37
38
#if !defined(LIBREPR_PLATFORM_MACOS)
39
# define LIBREPR_PLATFORM_MACOS OFF
40
#endif
41
42
#if !defined(LIBREPR_PLATFORM_UNIX)
43
# define LIBREPR_PLATFORM_UNIX OFF
44
#endif
45
46
47
#if defined(__clang__)
48
#define LIBREPR_COMPILER_CLANG ON
49
constexpr
inline
auto
compiler
=
Compiler::Clang
;
50
51
#elif defined(__GNUC__) || defined(__GNUG__)
52
#define LIBREPR_COMPILER_GCC ON
53
constexpr
inline
auto
compiler
=
Compiler::GCC
;
54
55
#elif defined(_MSC_VER)
56
#define LIBREPR_COMPILER_MSVC ON
57
constexpr
inline
auto
compiler
=
Compiler::MSVC
;
58
59
#else
60
#warning "Unsupported compiler"
61
constexpr
inline
auto
compiler
=
Compiler::Unknown
;
62
#endif
63
64
#if !defined(LIBREPR_COMPILER_CLANG)
65
# define LIBREPR_COMPILER_CLANG OFF
66
#endif
67
68
#if !defined(LIBREPR_COMPILER_GCC)
69
# define LIBREPR_COMPILER_GCC OFF
70
#endif
71
72
#if !defined(LIBREPR_COMPILER_MSVC)
73
# define LIBREPR_COMPILER_MSVC OFF
74
#endif
75
76
77
#if USING(LIBREPR_COMPILER_MSVC)
78
#define LIBREPR_FUNCTION_NAME __FUNCSIG__
79
#else
80
#define LIBREPR_FUNCTION_NAME __PRETTY_FUNCTION__
81
#endif
82
83
}
// namespace librepr
feature.h
librepr
Definition
ctvi/ctvi.h:9
librepr::code_for
std::string code_for()
Definition
repr:39
librepr::Compiler
Compiler
Definition
platform.h:7
librepr::Compiler::MSVC
@ MSVC
librepr::Compiler::GCC
@ GCC
librepr::Compiler::Unknown
@ Unknown
librepr::Compiler::Clang
@ Clang
librepr::compiler
constexpr auto compiler
Definition
platform.h:27
librepr::Platform
Platform
Definition
platform.h:6
librepr::Platform::UNIX
@ UNIX
librepr::Platform::Unknown
@ Unknown
librepr::Platform::macOS
@ macOS
librepr::Platform::Windows
@ Windows
librepr::Platform::Linux
@ Linux
include
librepr
macro
platform.h
Generated by
1.9.8, using the excellent
Doxygen Awesome
Theme