From 50f2e550e2b6d24d69f00b972b3789fe92c046df Mon Sep 17 00:00:00 2001
From: Thomas Goyne <plorkyeran@aegisub.org>
Date: Sun, 25 May 2014 15:06:23 -0700
Subject: [PATCH] Use std::thread with libc++

boost::thread is only used due to libstdc++ 4.8 missing a bunch of
stuff.
---
 libaegisub/unix/util.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/libaegisub/unix/util.cpp b/libaegisub/unix/util.cpp
index 32ca827f2..f5b1a6492 100644
--- a/libaegisub/unix/util.cpp
+++ b/libaegisub/unix/util.cpp
@@ -12,7 +12,13 @@
 // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
+#include <cstddef>
+
+#ifdef _LIBCPP_VERSION
+#include <thread>
+#else
 #include <boost/thread.hpp>
+#endif
 
 namespace agi { namespace util {
 
@@ -25,7 +31,11 @@ timeval time_log() {
 void SetThreadName(const char *) { }
 
 void sleep_for(int ms) {
+#ifdef __clang__
+	std::this_thread::sleep_for(std::chrono::milliseconds(ms));
+#else
 	boost::this_thread::sleep_for(boost::chrono::milliseconds(ms));
+#endif
 }
 
 } }
-- 
GitLab