@ -27,8 +27,11 @@
// It is fine to use C99 in this file because it will not be built with VS
// It is fine to use C99 in this file because it will not be built with VS
//========================================================================
//========================================================================
# define _POSIX_C_SOURCE 199309L
# include "internal.h"
# include "internal.h"
# include <unistd.h>
# include <sys/time.h>
# include <sys/time.h>
# include <time.h>
# include <time.h>
@ -41,7 +44,7 @@
//
//
void _glfwInitTimerPOSIX ( void )
void _glfwInitTimerPOSIX ( void )
{
{
# if defined(CLOCK_MONOTONIC )
# if defined(_POSIX_TIMERS) && defined(_POSIX_MONOTONIC_CLOCK )
struct timespec ts ;
struct timespec ts ;
if ( clock_gettime ( CLOCK_MONOTONIC , & ts ) = = 0 )
if ( clock_gettime ( CLOCK_MONOTONIC , & ts ) = = 0 )
@ -64,7 +67,7 @@ void _glfwInitTimerPOSIX(void)
uint64_t _glfwPlatformGetTimerValue ( void )
uint64_t _glfwPlatformGetTimerValue ( void )
{
{
# if defined(CLOCK_MONOTONIC )
# if defined(_POSIX_TIMERS) && defined(_POSIX_MONOTONIC_CLOCK )
if ( _glfw . timer . posix . monotonic )
if ( _glfw . timer . posix . monotonic )
{
{
struct timespec ts ;
struct timespec ts ;