Add the C++ standard to the getBuildInfo() function by adding two new macros: "token_expansion" and "make_string"

This commit is contained in:
Username404-59 2021-12-15 14:34:41 +01:00
parent 77d984cb45
commit cdafe654dc
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 5 additions and 1 deletions

View File

@ -26,6 +26,9 @@
#error "The "using enum" syntax is not supported by this compiler"
#endif
#define token_expansion(X) #X
#define make_string(X) token_expansion(X)
#include <exception>
#include <string_view>
#include <string>
@ -38,7 +41,8 @@ namespace Yerbacon {
consteval const char* getBuildInfo() noexcept { return
"Build info:\n"
" Optimization flags: " YBCON_FLAGS "\n"
" Compiler: " YBCON_COMPILER;
" Compiler: " YBCON_COMPILER "\n"
" C++ standard: " make_string(__cplusplus);
}
static void exit(const std::initializer_list<const char*> reason) {
std::for_each(reason.begin(), reason.end(), [](const char* current_string){