From 1c0bab542bbd5dbb853974901a675381d928b2f6 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 18 Mar 2024 08:31:29 +0100 Subject: [PATCH] [winpr,sysinfo] clock_gettime is available since POSIX 1993 --- winpr/libwinpr/sysinfo/sysinfo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/winpr/libwinpr/sysinfo/sysinfo.c b/winpr/libwinpr/sysinfo/sysinfo.c index d8e4d7c1c..bf81b8bd5 100644 --- a/winpr/libwinpr/sysinfo/sysinfo.c +++ b/winpr/libwinpr/sysinfo/sysinfo.c @@ -34,7 +34,7 @@ #endif #if !defined(_WIN32) -#if defined(_POSIX_SOURCE) && (_POSIX_C_SOURCE >= 200112L) +#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 199309L) #include #elif !defined(__APPLE__) #include @@ -579,7 +579,7 @@ ULONGLONG winpr_GetTickCount64(void) UINT64 winpr_GetTickCount64NS(void) { UINT64 ticks = 0; -#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L) +#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 199309L) struct timespec ts = { 0 }; if (clock_gettime(CLOCK_MONOTONIC_RAW, &ts) == 0) @@ -632,7 +632,7 @@ UINT64 winpr_GetUnixTimeNS(void) } t = { 0 }; GetSystemTimeAsFileTime(&t.ft); return (t.u64 - FILETIME_TO_UNIX_OFFSET_S * 10000000ull) * 100ull; -#elif _POSIX_C_SOURCE >= 200112L +#elif defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 199309L) struct timespec ts = { 0 }; if (clock_gettime(CLOCK_REALTIME, &ts) != 0) return 0;