Improve compiler version strings
This commit is contained in:
parent
7627b23212
commit
f1a49ef2a1
5 changed files with 24 additions and 0 deletions
|
@ -58,6 +58,9 @@ static int showVersion()
|
|||
# elif defined(__GNUC__)
|
||||
" with GCC");
|
||||
printf(" %d.%d.%d", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
|
||||
# elif defined(MSVC_VERSION_PATCH)
|
||||
" with MSVC");
|
||||
printf(" %d (%d.%d.%d.%d)", MSVC_VERSION, MSVC_VERSION_MAJOR, MSVC_VERSION_MINOR, MSVC_VERSION_PATCH, MSVC_VERSION_BUILD);
|
||||
# elif defined(_MSC_VER)
|
||||
" with MSVC");
|
||||
printf(" %d", MSVC_VERSION);
|
||||
|
|
|
@ -65,6 +65,8 @@ char *xmrig::Platform::createUserAgent()
|
|||
|
||||
# ifdef __clang__
|
||||
length += snprintf(buf + length, max - length, " clang/%d.%d.%d", __clang_major__, __clang_minor__, __clang_patchlevel__);
|
||||
# elif defined(__INTELC__)
|
||||
length += snprintf(buf, sizeof buf, "icc/%d.%d.%d.%d (gcc/%d.%d.%d)", __INTELC_MAJOR__, __INTELC_MINOR__, __INTELC_PATCH__, __INTEL_COMPILER_BUILD_DATE, __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
|
||||
# elif defined(__GNUC__)
|
||||
length += snprintf(buf + length, max - length, " gcc/%d.%d.%d", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
|
||||
# endif
|
||||
|
|
|
@ -62,6 +62,8 @@ char *xmrig::Platform::createUserAgent()
|
|||
|
||||
# ifdef __GNUC__
|
||||
snprintf(buf + length, max - length, " gcc/%d.%d.%d", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
|
||||
# elif defined(MSVC_VERSION_PATCH)
|
||||
snprintf(buf + length, max - length, " msvc/%dv%d.%d.%d.%d", MSVC_VERSION, MSVC_VERSION_MAJOR, MSVC_VERSION_MINOR, MSVC_VERSION_PATCH, MSVC_VERSION_BUILD);
|
||||
# elif _MSC_VER
|
||||
snprintf(buf + length, max - length, " msvc/%d", MSVC_VERSION);
|
||||
# endif
|
||||
|
|
|
@ -136,8 +136,12 @@ void xmrig::BaseConfig::printVersions()
|
|||
|
||||
# if defined(__clang__)
|
||||
snprintf(buf, sizeof buf, "clang/%d.%d.%d", __clang_major__, __clang_minor__, __clang_patchlevel__);
|
||||
# elif defined(__INTELC__)
|
||||
snprintf(buf, sizeof buf, "icc/%d.%d.%d.%d (gcc/%d.%d.%d)", __INTELC_MAJOR__, __INTELC_MINOR__, __INTELC_PATCH__, __INTEL_COMPILER_BUILD_DATE, __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
|
||||
# elif defined(__GNUC__)
|
||||
snprintf(buf, sizeof buf, "gcc/%d.%d.%d", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
|
||||
# elif defined(MSVC_VERSION_PATCH)
|
||||
snprintf(buf, sizeof buf, "MSVC/%d (%d.%d.%d.%d)", MSVC_VERSION, MSVC_VERSION_MAJOR, MSVC_VERSION_MINOR, MSVC_VERSION_PATCH, MSVC_VERSION_BUILD);
|
||||
# elif defined(_MSC_VER)
|
||||
snprintf(buf, sizeof buf, "MSVC/%d", MSVC_VERSION);
|
||||
# endif
|
||||
|
|
|
@ -50,4 +50,17 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_FULL_VER)
|
||||
# define MSVC_VERSION_MAJOR ((_MSC_FULL_VER / 10000000) >> 0)
|
||||
# define MSVC_VERSION_MINOR (((_MSC_FULL_VER - (MSVC_VERSION_MAJOR * 10000000)) / 100000) >> 0)
|
||||
# define MSVC_VERSION_PATCH (_MSC_FULL_VER - (MSVC_VERSION_MAJOR * 10000000) - (MSVC_VERSION_MINOR * 100000))
|
||||
# define MSVC_VERSION_BUILD _MSC_BUILD
|
||||
#endif
|
||||
|
||||
#if defined(__INTEL_COMPILER)
|
||||
# define __INTELC_MAJOR__ ((__INTEL_COMPILER / 100) >> 0)
|
||||
# define __INTELC_MINOR__ (((__INTEL_COMPILER - (__INTELC_MAJOR__ * 100)) / 10) >> 0)
|
||||
# define __INTELC_PATCH__ (__INTEL_COMPILER - (__INTELC_MAJOR__ * 100) - (__INTELC_MINOR__ * 10))
|
||||
#endif
|
||||
|
||||
#endif /* XMRIG_VERSION_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue