diff --git a/cmake/MujocoOptions.cmake b/cmake/MujocoOptions.cmake index be68de3d..3e3f080f 100644 --- a/cmake/MujocoOptions.cmake +++ b/cmake/MujocoOptions.cmake @@ -99,12 +99,9 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # Set -Wimplicit-fallthrough=5 to only allow fallthrough annotation via __attribute__. set(EXTRA_COMPILE_OPTIONS ${EXTRA_COMPILE_OPTIONS} -Wimplicit-fallthrough=5 - -Wno-maybe-uninitialized -Wno-c++20-extensions + -Wno-maybe-uninitialized ) endif() - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(EXTRA_COMPILE_OPTIONS ${EXTRA_COMPILE_OPTIONS} -Wno-c++20-designator) - endif() endif() include(MujocoHarden) diff --git a/sample/cmake/SampleOptions.cmake b/sample/cmake/SampleOptions.cmake index be68de3d..3e3f080f 100644 --- a/sample/cmake/SampleOptions.cmake +++ b/sample/cmake/SampleOptions.cmake @@ -99,12 +99,9 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # Set -Wimplicit-fallthrough=5 to only allow fallthrough annotation via __attribute__. set(EXTRA_COMPILE_OPTIONS ${EXTRA_COMPILE_OPTIONS} -Wimplicit-fallthrough=5 - -Wno-maybe-uninitialized -Wno-c++20-extensions + -Wno-maybe-uninitialized ) endif() - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(EXTRA_COMPILE_OPTIONS ${EXTRA_COMPILE_OPTIONS} -Wno-c++20-designator) - endif() endif() include(MujocoHarden) diff --git a/simulate/cmake/SimulateOptions.cmake b/simulate/cmake/SimulateOptions.cmake index be68de3d..3e3f080f 100644 --- a/simulate/cmake/SimulateOptions.cmake +++ b/simulate/cmake/SimulateOptions.cmake @@ -99,12 +99,9 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # Set -Wimplicit-fallthrough=5 to only allow fallthrough annotation via __attribute__. set(EXTRA_COMPILE_OPTIONS ${EXTRA_COMPILE_OPTIONS} -Wimplicit-fallthrough=5 - -Wno-maybe-uninitialized -Wno-c++20-extensions + -Wno-maybe-uninitialized ) endif() - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(EXTRA_COMPILE_OPTIONS ${EXTRA_COMPILE_OPTIONS} -Wno-c++20-designator) - endif() endif() include(MujocoHarden) diff --git a/src/thread/thread_pool.cc b/src/thread/thread_pool.cc index 8842a242..6916849f 100644 --- a/src/thread/thread_pool.cc +++ b/src/thread/thread_pool.cc @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -41,8 +42,9 @@ struct WorkerThread { // An mjTask for shutting down this worker. mjTask shutdown_task_ { - .func = &ShutdownFunction, - .args = nullptr, + &ShutdownFunction, + nullptr, + mjTASK_NEW }; }; } // namespace @@ -51,11 +53,12 @@ struct WorkerThread { // (The public mjThreadPool C struct is an opaque one.) class ThreadPoolImpl : public mjThreadPool { public: - ThreadPoolImpl(int num_worker) : mjThreadPool{.nworker = num_worker} { + ThreadPoolImpl(int num_worker) : mjThreadPool{num_worker} { // initialize worker threads for (int i = 0; i < num_worker; ++i) { - workers_.push_back( - {std::make_unique(ThreadPoolWorker, this)}); + WorkerThread worker{ + std::make_unique(ThreadPoolWorker, this)}; + workers_.push_back(std::move(worker)); } }