Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
version.h
Go to the documentation of this file.
1#pragma once
2
3#include <misc/global.h>
4#include <string>
5
6namespace sf
7{
8
12inline std::string getGCCVersion()
13{
14#ifdef __GNUC__
15 return std::to_string(__GNUC__) + '.' + std::to_string(__GNUC_MINOR__) + '.' + std::to_string(__GNUC_PATCHLEVEL__);
16#else
17 return "?.?.?";
18#endif
19}
20
24inline std::string_view getCppStandard()
25{
26#if __cplusplus == 199711L
27 return "C++98/03";
28#elif __cplusplus == 201103L
29 return "C++11";
30#elif __cplusplus == 201402L
31 return "C++14";
32#elif __cplusplus == 201703L
33 return "C++17";
34#elif __cplusplus == 202002L
35 return "C++20";
36#elif __cplusplus == 202302L
37 return "C++23";
38#else
39 return "Unknown C++ standard";
40#endif
41}
42
47
51_MISC_FUNC std::string_view getCpuArchitecture();
52
53}// namespace sf
#define _MISC_FUNC
Definition misc/global.h:39
Definition Application.h:10
std::string getGCCVersion()
Gets the GNU compiler version.
Definition version.h:12
_MISC_FUNC std::string_view getCpuArchitecture()
Gets the CPU architecture returned from 'uname -m' command.
std::string_view getCppStandard()
Gets the C++ standard used.
Definition version.h:24
_MISC_FUNC std::string getOSVersion()
Gets the OS and version used.