Use std::this_thread everywhere

The previous logic wouldn't compile on linux using clang.

With the meson build requiring c++14, there's no need for platform
specific code. Really, the entire agi::util::sleep_for function could be
removed entirely, but I'll keep the patch minimal for now.
This commit is contained in:
arch1t3cht 2022-07-27 15:20:03 +02:00
parent 86354050f3
commit 1772dd17ae

View file

@ -15,22 +15,13 @@
#include <libaegisub/util.h> #include <libaegisub/util.h>
#include <cstddef> #include <cstddef>
#ifdef _LIBCPP_VERSION
#include <thread> #include <thread>
#else
#include <boost/thread.hpp>
#endif
namespace agi { namespace util { namespace agi { namespace util {
void SetThreadName(const char *) { } void SetThreadName(const char *) { }
void sleep_for(int ms) { void sleep_for(int ms) {
#ifdef __clang__
std::this_thread::sleep_for(std::chrono::milliseconds(ms)); std::this_thread::sleep_for(std::chrono::milliseconds(ms));
#else
boost::this_thread::sleep_for(boost::chrono::milliseconds(ms));
#endif
} }
} } } }