The code in question is:
unsigned thread::hardware_concurrency()
{
#if defined(PTW32_VERSION) || defined(__hpux)
return pthread_num_processors_np();
#elif defined(_GNU_SOURCE)
return get_nprocs();
It seems that get_nprocs() is always implemented by Glibc. Worst-case it'd
be a dummy stub. I'd just try to figure out why <sys/sysinfo.h> is not
included or not providing its declaration.
In addition to what everyone has said, _GNU_SOURCE seems the wrong check
to me, that's a user definition to request the system to expose GNU
extensions, if the code is trying to check for a glibc implementation
it should be using __GLIBC__ instead, or I guess better yet, it should
be checking for the functions availability at build time and use the
best one found.