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:
parent
4ea95609cc
commit
37ef6b4968
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user