mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-25 15:41:05 +00:00
15 lines
343 B
C++
15 lines
343 B
C++
|
// Check for strerror_r.
|
||
|
// It can be either the POSIX version (which returns int) or the GNU version
|
||
|
// (which returns char *).
|
||
|
|
||
|
#include <cstring>
|
||
|
#include <type_traits>
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
char buffer[200];
|
||
|
auto res{strerror_r(1, buffer, 200)};
|
||
|
// Sidestep type differences. We don't really care what the value is.
|
||
|
return not not res;
|
||
|
}
|