From 7d51a80007b3a9090f3cce6fd9b8c88d38b8d687 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Tue, 8 Sep 2020 03:56:52 +0100 Subject: [PATCH] Remove C++11 from GLFW3 platform backend --- src/Backends/Platform/GLFW3.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/Backends/Platform/GLFW3.cpp b/src/Backends/Platform/GLFW3.cpp index df7b234b..93135607 100644 --- a/src/Backends/Platform/GLFW3.cpp +++ b/src/Backends/Platform/GLFW3.cpp @@ -1,13 +1,20 @@ #include "../Misc.h" -#include #include #include #include #include #include #include -#include + +#if __cplusplus >= 201103L + #include + #include +#elif defined(_WIN32) + #include "windows.h" +#else + #include +#endif #include @@ -319,6 +326,12 @@ unsigned long Backend_GetTicks(void) void Backend_Delay(unsigned int ticks) { +#if __cplusplus >= 201103L // GLFW3 doesn't have a delay function, so here's some butt-ugly C++11 std::this_thread::sleep_for(std::chrono::milliseconds(ticks)); +#elif defined(_WIN32) + Sleep(ticks); +#else + usleep(ticks * 1000); +#endif }