mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-17 16:32:11 +01:00
Add C compiler version to test and bench output
This commit is contained in:
1 parent
e071e171cc
commit
031783f9c8
1 file changed
+6
-2
@@ -148,12 +148,16 @@ bool check_focus() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// https://www.guyrutenberg.com/2008/12/20/expanding-macros-into-string-constants-in-c/
|
||||
#define WUFFS_TESTLIB_QUOTE_EXPAND(x) #x
|
||||
#define WUFFS_TESTLIB_QUOTE(x) WUFFS_TESTLIB_QUOTE_EXPAND(x)
|
||||
|
||||
// The order matters here. Clang also defines "__GNUC__".
|
||||
#if defined(__clang__)
|
||||
const char* cc = "clang";
|
||||
const char* cc = "clang" WUFFS_TESTLIB_QUOTE(__clang_major__);
|
||||
const char* cc_version = __clang_version__;
|
||||
#elif defined(__GNUC__)
|
||||
const char* cc = "gcc";
|
||||
const char* cc = "gcc" WUFFS_TESTLIB_QUOTE(__GNUC__);
|
||||
const char* cc_version = __VERSION__;
|
||||
#elif defined(_MSC_VER)
|
||||
const char* cc = "cl";
|
||||
|
||||
Reference in new issue
Block a user