Skip to content

Commit

Permalink
Fix conditional compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
HiGarfield committed Jan 13, 2025
1 parent d7cd004 commit 8680c33
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ const char *__basename(const char *path);
* Sleep for a specified timespec duration
*/
#ifndef sleep_timespec
#if defined(__linux__) && _POSIX_C_SOURCE >= 200112L && defined(CLOCK_TAI)
#if defined(__linux__) && defined(_POSIX_C_SOURCE) && \
_POSIX_C_SOURCE >= 200112L && defined(CLOCK_TAI)
#define sleep_timespec(t) clock_nanosleep(CLOCK_TAI, 0, (t), NULL)
#else
#define sleep_timespec(t) nanosleep((t), NULL)
Expand All @@ -134,7 +135,7 @@ const char *__basename(const char *path);
* Retrieves the current time into a timespec structure
*/
#ifndef get_time
#if _POSIX_TIMERS > 0
#if defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0
#if defined(CLOCK_TAI)
#define get_time(ts) clock_gettime(CLOCK_TAI, (ts))
#elif defined(CLOCK_MONOTONIC)
Expand Down

0 comments on commit 8680c33

Please sign in to comment.