diff --git a/src/btop.cpp b/src/btop.cpp index fd6b38d..1ec2a10 100644 --- a/src/btop.cpp +++ b/src/btop.cpp @@ -37,6 +37,11 @@ tab-size = 4 #include #include #endif +#if !defined(__clang__) && __GNUC__ < 11 + #include +#else + #include +#endif #include #include @@ -336,14 +341,12 @@ namespace Runner { atomic coreNum_reset (false); //* Setup semaphore for triggering thread to do work -#if __GNUC__ < 11 - #include +#if !defined(__clang__) && __GNUC__ < 11 sem_t do_work; inline void thread_sem_init() { sem_init(&do_work, 0, 0); } inline void thread_wait() { sem_wait(&do_work); } inline void thread_trigger() { sem_post(&do_work); } #else - #include std::binary_semaphore do_work(0); inline void thread_sem_init() { ; } inline void thread_wait() { do_work.acquire(); }