[Libreoffice-commits] core.git: tools/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 6 20:08:35 UTC 2021


 tools/source/datetime/ttime.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit ccf88845752a978ff3536c4bf66658993939caad
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Jul 6 10:23:55 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jul 6 22:07:59 2021 +0200

    actually use CLOCK_MONOTONIC in tools::time
    
    some of the code was not copied from sal/ correctly
    
    Change-Id: I0a84b61eeab6a1b51eaa8ad303909373c52a6bb8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118529
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/tools/source/datetime/ttime.cxx b/tools/source/datetime/ttime.cxx
index 0049c33efd9d..c6c89c934886 100644
--- a/tools/source/datetime/ttime.cxx
+++ b/tools/source/datetime/ttime.cxx
@@ -29,6 +29,7 @@
 #include <mmsystem.h>
 #elif defined UNX
 #include <sys/time.h>
+#include <unistd.h>
 #endif
 
 #include <time.h>
@@ -473,7 +474,7 @@ sal_uInt64 tools::Time::GetMonotonicTicks()
         mach_timebase_info( &info );
     nMicroSeconds = mach_absolute_time() * static_cast<double>(info.numer / info.denom) / 1000;
 #else
-#if defined(USE_CLOCK_GETTIME)
+#if defined(_POSIX_TIMERS)
     struct timespec currentTime;
     clock_gettime( CLOCK_MONOTONIC, &currentTime );
     nMicroSeconds = currentTime.tv_sec * 1000 * 1000 + currentTime.tv_nsec / 1000;


More information about the Libreoffice-commits mailing list