Add the C++ standard to the getBuildInfo() function by adding two new macros: "token_expansion" and "make_string"
This commit is contained in:
		
							parent
							
								
									77d984cb45
								
							
						
					
					
						commit
						cdafe654dc
					
				| @ -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){ | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user