Fix redefinition of variable "line_size". Fix use of sysctlbyname() without including . https://lists.gnu.org/archive/html/bug-commoncpp/2017-10/msg00000.html --- corelib/thread.cpp.orig 2015-12-13 22:28:25.000000000 +1100 +++ corelib/thread.cpp 2019-05-22 17:04:09.000000000 +1000 @@ -27,6 +27,11 @@ #include #include +#ifdef __APPLE__ +#include +#include +#endif + #if _POSIX_PRIORITY_SCHEDULING > 0 #include static int realtime_policy = SCHED_FIFO; @@ -1311,9 +1316,10 @@ size_t Thread::cache(void) free(buffer); return line_size; #elif defined(__APPLE__) - size_t line_size = 0; - size_t sizeof_line_size = sizeof(line_size); - sysctlbyname("hw.cachelinesize", &line_size, &sizeof_line_size, 0, 0); + size_t temp_line_size = 0; + size_t sizeof_line_size = sizeof(temp_line_size); + sysctlbyname("hw.cachelinesize", &temp_line_size, &sizeof_line_size, 0, 0); + line_size = temp_line_size; return line_size; #elif defined(_SC_LEVEL1_DCACHE_LINESIZE) line_size = sysconf(_SC_LEVEL1_DCACHE_LINESIZE);