From 1f4b7a04687e94651a9609c2b18186afa2f79e5e Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 1 Jun 2019 22:03:53 -0700 Subject: [PATCH] ircd::info: Add GNUC version information. --- include/ircd/info.h | 3 +++ ircd/info.cc | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/include/ircd/info.h b/include/ircd/info.h index 40ea80cca..0e946aeb6 100644 --- a/include/ircd/info.h +++ b/include/ircd/info.h @@ -57,10 +57,13 @@ namespace ircd::info extern const ::utsname utsname; #endif + // Kernel information extern const string_view kernel_name; extern const string_view kernel_release; extern const versions kernel_version; + // Toolchain and library information + extern const versions gnuc_version_api; extern const versions glibc_version_api; extern const versions glibc_version_abi; diff --git a/ircd/info.cc b/ircd/info.cc index 5362e8621..ec880f647 100644 --- a/ircd/info.cc +++ b/ircd/info.cc @@ -295,6 +295,31 @@ ircd::info::kernel_version utsname.release }; +// +// gnuc +// +#if defined(__GNUC__) && defined(__GLIBC__) + +decltype(ircd::info::gnuc_version_api) +ircd::info::gnuc_version_api +{ + "gnuc", versions::API, 0, + { + __GNUC__, + __GNUC_MINOR__, + __GNUC_PATCHLEVEL__, + }, + + // version string + #if defined(__VERSION__) + __VERSION__ + #else + "<__VERSION__ undefined>" + #endif +}; + +#endif defined(__GNUC__) && defined(__GLIBC__) + // // glibc //