From cc5ae1831e54702f7bb8477ab3b14ab9832c064c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 29 Mar 2010 14:25:16 +0200 Subject: Ensure that we return QPair in all cases. Fixes a compilation failure on AIX. Reviewed-By: Marius Storm-Olsen --- src/corelib/tools/qelapsedtimer_unix.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/corelib/tools/qelapsedtimer_unix.cpp') diff --git a/src/corelib/tools/qelapsedtimer_unix.cpp b/src/corelib/tools/qelapsedtimer_unix.cpp index 85d7fa81db..1a7bc71929 100644 --- a/src/corelib/tools/qelapsedtimer_unix.cpp +++ b/src/corelib/tools/qelapsedtimer_unix.cpp @@ -97,19 +97,19 @@ static inline QPair do_gettime() #if (_POSIX_MONOTONIC_CLOCK-0 > 0) timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); - return qMakePair(ts.tv_sec, ts.tv_nsec); + return qMakePair(ts.tv_sec, ts.tv_nsec); #else # if !defined(QT_NO_CLOCK_MONOTONIC) && !defined(QT_BOOTSTRAPPED) if (QElapsedTimer::isMonotonic()) { timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); - return qMakePair(ts.tv_sec, ts.tv_nsec); + return qMakePair(ts.tv_sec, ts.tv_nsec); } # endif // use gettimeofday timeval tv; ::gettimeofday(&tv, 0); - return qMakePair(tv.tv_sec, tv.tv_usec); + return qMakePair(tv.tv_sec, tv.tv_usec); #endif } -- cgit v1.2.1 From ec0fe5bb327f2533dcbb35855ca0d2a7f9a85581 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 29 Mar 2010 15:10:14 +0200 Subject: Fix compilation on HP-UXi: _SC_MONOTONIC_CLOCK isn't defined Reviewed-by: Trust Me --- src/corelib/tools/qelapsedtimer_unix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/tools/qelapsedtimer_unix.cpp') diff --git a/src/corelib/tools/qelapsedtimer_unix.cpp b/src/corelib/tools/qelapsedtimer_unix.cpp index 1a7bc71929..2c4ea584ea 100644 --- a/src/corelib/tools/qelapsedtimer_unix.cpp +++ b/src/corelib/tools/qelapsedtimer_unix.cpp @@ -74,7 +74,7 @@ bool QElapsedTimer::isMonotonic() static int returnValue = 0; if (returnValue == 0) { -# if (_POSIX_MONOTONIC_CLOCK-0 < 0) +# if (_POSIX_MONOTONIC_CLOCK-0 < 0) || !defined(_SC_MONOTONIC_CLOCK) returnValue = -1; # elif (_POSIX_MONOTONIC_CLOCK == 0) // detect if the system support monotonic timers -- cgit v1.2.1