--- a/src/ObjectSystem/timeActions.cc +++ b/src/ObjectSystem/timeActions.cc @@ -40,7 +40,14 @@ DebugSave(r, clock_gettime(CLOCK_REALTIME, &timeValue)); Assert(r == 0, "clock_gettime() failed: " << strerror(errno)); +#if defined(_TIME_BITS) && (_TIME_BITS == 64) && (__SIZEOF_LONG__ == 4) + Int64 sec = timeValue.tv_sec; + mpz_class nanoSeconds(static_cast(sec >> 32)); + nanoSeconds <<= 32; + nanoSeconds += static_cast(sec & 0xffffffffUL); +#else mpz_class nanoSeconds(timeValue.tv_sec); +#endif nanoSeconds *= BILLION; nanoSeconds += timeValue.tv_nsec;