OpenBSD: use clock_gettime() provided by OS

The use of clock_gettime() is limited to systems having _POSIX_TIMERS
defined, however OpenBSD implements clock_gettime() but does not have the
posix define. Enable using clock_gettime() on OpenBSD as well.

Change-Id: I785954fe61b42b15755ca625a766c9a95179ae8d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Ralf Nolden 2016-06-06 12:00:11 +02:00
parent 4ea95609cc
commit 37ef6b4968
2 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@
int main(int, char **)
{
#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0)
#if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0)) || defined(__OpenBSD__)
timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
#else

View File

@ -71,7 +71,7 @@ static qint64 getticks()
static qint64 getticks()
{
#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0)
#if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0)) || defined(Q_OS_OPENBSD)
clockid_t clockId;
#ifndef _POSIX_THREAD_CPUTIME