From 4606ec35fd7dd5c8c2bb73fb318d1184c8a14882 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Thu, 13 Oct 2016 21:29:18 +0200 Subject: [PATCH] [DEV] remove dependency of unistd.h --- gale/Thread.cpp | 4 ++-- gale/context/Context.cpp | 4 ++-- gale/context/IOs/Context.cpp | 2 +- gale/context/MacOs/Context.mm | 2 +- gale/context/X11/Context.cpp | 2 +- gale/context/directFB/Context.cpp | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gale/Thread.cpp b/gale/Thread.cpp index 3f49ebd..8d497c5 100644 --- a/gale/Thread.cpp +++ b/gale/Thread.cpp @@ -5,7 +5,7 @@ */ #include #include -#include + #include #if defined(__TARGET_OS__Android) @@ -97,7 +97,7 @@ void gale::Thread::threadCall() { while (m_state != state::stopping) { if (m_state == state::starting) { GALE_DEBUG("run std::thread [NOTHING to do]"); - usleep(1000); + std::this_thread::sleep_for(std::chrono::milliseconds(1)); continue; } if (onThreadCall() == true) { diff --git a/gale/context/Context.cpp b/gale/context/Context.cpp index bb586b1..77b3055 100644 --- a/gale/context/Context.cpp +++ b/gale/context/Context.cpp @@ -4,7 +4,7 @@ * @license APACHE v2.0 (see license file) */ -#include + #include #include @@ -532,7 +532,7 @@ bool gale::Context::OS_Draw(bool _displayEveryTime) { // this is to prevent the multiple display at the a high frequency ... #if (!defined(__TARGET_OS__Android) && !defined(__TARGET_OS__Windows)) if(currentTime - m_previousDisplayTime < 1000000/120) { - usleep(1000); + std::this_thread::sleep_for(std::chrono::milliseconds(1)); gale::openGL::threadHasNoMoreContext(); return false; } diff --git a/gale/context/IOs/Context.cpp b/gale/context/IOs/Context.cpp index c224fdf..aaa55e7 100644 --- a/gale/context/IOs/Context.cpp +++ b/gale/context/IOs/Context.cpp @@ -17,7 +17,7 @@ #include #include -#include + #include #include #include diff --git a/gale/context/MacOs/Context.mm b/gale/context/MacOs/Context.mm index 7fbd0ed..ff77bb0 100644 --- a/gale/context/MacOs/Context.mm +++ b/gale/context/MacOs/Context.mm @@ -18,7 +18,7 @@ #include #include -#include + #include #include #include diff --git a/gale/context/X11/Context.cpp b/gale/context/X11/Context.cpp index 6acfbe5..74505e4 100644 --- a/gale/context/X11/Context.cpp +++ b/gale/context/X11/Context.cpp @@ -4,7 +4,7 @@ * @license APACHE v2.0 (see license file) */ -#include + #include #include #include diff --git a/gale/context/directFB/Context.cpp b/gale/context/directFB/Context.cpp index af87ada..8f91990 100644 --- a/gale/context/directFB/Context.cpp +++ b/gale/context/directFB/Context.cpp @@ -36,7 +36,7 @@ #include #include -#include + #include #include #include