Remove C++11 from GLFW3 platform backend
This commit is contained in:
parent
84d6b50bc2
commit
7d51a80007
1 changed files with 15 additions and 2 deletions
|
@ -1,13 +1,20 @@
|
||||||
#include "../Misc.h"
|
#include "../Misc.h"
|
||||||
|
|
||||||
#include <chrono>
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#if __cplusplus >= 201103L
|
||||||
|
#include <chrono>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
#elif defined(_WIN32)
|
||||||
|
#include "windows.h"
|
||||||
|
#else
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
|
|
||||||
|
@ -319,6 +326,12 @@ unsigned long Backend_GetTicks(void)
|
||||||
|
|
||||||
void Backend_Delay(unsigned int ticks)
|
void Backend_Delay(unsigned int ticks)
|
||||||
{
|
{
|
||||||
|
#if __cplusplus >= 201103L
|
||||||
// GLFW3 doesn't have a delay function, so here's some butt-ugly C++11
|
// GLFW3 doesn't have a delay function, so here's some butt-ugly C++11
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(ticks));
|
std::this_thread::sleep_for(std::chrono::milliseconds(ticks));
|
||||||
|
#elif defined(_WIN32)
|
||||||
|
Sleep(ticks);
|
||||||
|
#else
|
||||||
|
usleep(ticks * 1000);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue