[Libreoffice-commits] core.git: 2 commits - sal/osl

Tor Lillqvist tml at iki.fi
Mon May 20 06:08:51 PDT 2013


 sal/osl/unx/time.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit e913d2865521c56b15d22d42d24191c5d19e6ca4
Author: Tor Lillqvist <tml at iki.fi>
Date:   Mon May 20 15:57:22 2013 +0300

    Also iOS has tm_gmtoff
    
    Change-Id: Ic0f883672b4bde3142ac257a57464bdbb90df96b

diff --git a/sal/osl/unx/time.c b/sal/osl/unx/time.c
index 3971664..94a935e 100644
--- a/sal/osl/unx/time.c
+++ b/sal/osl/unx/time.c
@@ -31,7 +31,7 @@
 #endif
 
 /* FIXME: detection should be done in configure script */
-#if defined(MACOSX) || defined(FREEBSD) || defined(NETBSD) || \
+#if defined(MACOSX) || defined(IOS) || defined(FREEBSD) || defined(NETBSD) || \
     defined(LINUX) || defined(OPENBSD) || defined(DRAGONFLY)
 #define STRUCT_TM_HAS_GMTOFF 1
 
commit beeedfd818d230ea6bc16c514a97910eaa518580
Author: Tor Lillqvist <tml at iki.fi>
Date:   Mon May 20 15:56:24 2013 +0300

    iOS is based on Mach, too
    
    Change-Id: I9b6bdc374c9e92af754094f31e1ff212fb386f9e

diff --git a/sal/osl/unx/time.c b/sal/osl/unx/time.c
index 70512f2..3971664 100644
--- a/sal/osl/unx/time.c
+++ b/sal/osl/unx/time.c
@@ -26,7 +26,7 @@
 #include <assert.h>
 #include <unistd.h>
 
-#if defined(MACOSX)
+#if defined(MACOSX) || defined(IOS)
 #include <mach/mach_time.h>
 #endif
 
@@ -39,7 +39,7 @@
 #define HAS_ALTZONE 1
 #endif
 
-#if defined(MACOSX)
+#if defined(MACOSX) || defined(IOS)
 typedef sal_uInt64 osl_time_t;
 static double adjust_time_factor;
 #else
@@ -59,7 +59,7 @@ static osl_time_t startTime;
 
 sal_Bool SAL_CALL osl_getSystemTime(TimeValue* tv)
 {
-#if defined(MACOSX)
+#if defined(MACOSX) || defined(IOS)
     double diff = (double)(mach_absolute_time() - startTime) * adjust_time_factor;
     tv->Seconds = (sal_uInt32)diff;
     tv->Nanosec = (sal_uInt32)((diff - tv->Seconds) * 1e9);
@@ -277,12 +277,12 @@ sal_Bool SAL_CALL osl_getSystemTimeFromLocalTime( TimeValue* pLocalTimeVal, Time
 
 void sal_initGlobalTimer()
 {
-#if defined(MACOSX)
+#if defined(MACOSX) || defined(IOS)
   mach_timebase_info_data_t timebase;
   mach_timebase_info(&timebase);
   adjust_time_factor = 1e-9 * (double)timebase.numer / (double)(timebase.denom);
   startTime = mach_absolute_time();
-#else /* NDef MACOSX */
+#else /* ! (MACOSX || IOS) */
   int res;
 #if defined(USE_CLOCK_GETTIME)
   res = clock_gettime(CLOCK_REALTIME, &startTime);
@@ -290,14 +290,14 @@ void sal_initGlobalTimer()
   res = gettimeofday( &startTime, NULL );
 #endif /* NDef USE_CLOCK_GETTIME */
   assert(res == 0);
-#endif /* NDef MACOSX */
+#endif /* ! (MACOSX || IOS) */
 }
 
 sal_uInt32 SAL_CALL osl_getGlobalTimer()
 {
     sal_uInt32 nSeconds;
 
-#if defined(MACOSX)
+#if defined(MACOSX) || defined(IOS)
     startTime = mach_absolute_time();
 
     double diff = (double)(mach_absolute_time() - startTime) * adjust_time_factor * 1000;


More information about the Libreoffice-commits mailing list