LIBC version reporting value.
The spy::libc
object can be compared to any other libc related value to verify if the code being compiled with a specific version of the libc.
Any libc related value can be checked for equality or ordering for a given version. The targeted version is then specified using a libc-dependent literal.
Additionally, any of the libc related value are convertible to bool
. They evaluates to true
if they matches the correct libc currently used.
Name | Vendor |
spy::cloudabi_ | CloudABI |
spy::uc_ | uClibc |
spy::vms_ | VMS |
spy::zos_ | zOS |
spy::gnu_ | GNU |
#include <spy/spy.hpp>
#include <iostream>
int main()
{
if constexpr(
spy::libc == spy::gnu_ ) std::cout <<
"This code is compiled with the GNU libc.\n";
else if constexpr(
spy::libc == spy::zos_ ) std::cout <<
"This code is compiled with the zOS libc.\n";
else if constexpr(
spy::libc == spy::vms_ ) std::cout <<
"This code is compiled with the VMS libc.\n";
if constexpr( spy::gnu_ ) std::cout << "This code is compiled with the GNU libc.\n";
else if constexpr( spy::zos_ ) std::cout << "This code is compiled with the zOS libc.\n";
else if constexpr( spy::vms_ ) std::cout << "This code is compiled with the VMS libc.\n";
}
constexpr auto libc
LIBC version reporting value.
Definition: libc.hpp:112