From cdafe654dc3623d21169c1603c0caced802bcda9 Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Wed, 15 Dec 2021 14:34:41 +0100 Subject: [PATCH] Add the C++ standard to the getBuildInfo() function by adding two new macros: "token_expansion" and "make_string" --- src/headers/Yerbacon.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/headers/Yerbacon.hpp b/src/headers/Yerbacon.hpp index ae98e42..adb5abd 100644 --- a/src/headers/Yerbacon.hpp +++ b/src/headers/Yerbacon.hpp @@ -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 #include #include @@ -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 reason) { std::for_each(reason.begin(), reason.end(), [](const char* current_string){