Skip to content

Commit 6c7ee3f

Browse files
authored
Merge pull request #16 from brad0/openbsd_monotonic
Use monotonic clock on OpenBSD
2 parents 52645d6 + 14d6f57 commit 6c7ee3f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utp_utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ static uint64 __GetMicroseconds()
143143

144144
#else // !__APPLE__
145145

146-
#if ! (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0 && defined(CLOCK_MONOTONIC))
146+
#if ! ((defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0 && defined(CLOCK_MONOTONIC)) || defined(__OpenBSD__))
147147
#pragma message ("Using non-monotonic function gettimeofday() in UTP_GetMicroseconds()")
148148
#endif
149149

@@ -155,7 +155,7 @@ static uint64_t __GetMicroseconds()
155155
{
156156
struct timeval tv;
157157

158-
#if defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0 && defined(CLOCK_MONOTONIC)
158+
#if ((defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0 && defined(CLOCK_MONOTONIC)) || defined(__OpenBSD__))
159159
static int have_posix_clocks = -1;
160160
int rc;
161161

0 commit comments

Comments
 (0)