Add define to have CLOCK_MONOTONIC work in c99

If we compile with c99 without gnu extensions (gnu99) we need this
define, to have CLOCK_MONOTONIC and similar macros available
This commit is contained in:
Michael Vetter 2017-06-11 11:20:30 +02:00
parent b6d7fa9bb0
commit 272073785f
3 changed files with 8 additions and 2 deletions

View file

@ -148,8 +148,9 @@ float GetGesturePinchAngle(void); // Get gesture pinch ang
int __stdcall QueryPerformanceCounter(unsigned long long int *lpPerformanceCount);
int __stdcall QueryPerformanceFrequency(unsigned long long int *lpFrequency);
#elif defined(__linux__)
#include <sys/time.h> // Required for: timespec
#include <time.h> // Required for: clock_gettime()
#define _POSIX_C_SOURCE 199309L // Required for CLOCK_MONOTONIC if compiled with c99 without gnu ext.
#include <sys/time.h> // Required for: timespec
#include <time.h> // Required for: clock_gettime()
#endif
//----------------------------------------------------------------------------------