Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3889

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/89/3889/1

Fix build on fedora and debian by checking _POSIX_C_SOURCE

Change-Id: I12809d970d0a2a4ebb946675f904832ff37e029f
---
M sal/osl/unx/time.c
1 file changed, 8 insertions(+), 2 deletions(-)



diff --git a/sal/osl/unx/time.c b/sal/osl/unx/time.c
index c99036b..7a2d355 100644
--- a/sal/osl/unx/time.c
+++ b/sal/osl/unx/time.c
@@ -24,6 +24,8 @@
 #include <osl/time.h>
 #include <time.h>
 
+#include <features.h>
+
 /* FIXME: detection should be done in configure script */
 #if defined(MACOSX) || defined(FREEBSD) || defined(NETBSD) || \
     defined(LINUX) || defined(OPENBSD) || defined(DRAGONFLY)
@@ -33,6 +35,10 @@
 #define HAS_ALTZONE 1
 #endif
 
+#if defined(LINUX) & (_POSIX_C_SOURCE >= 199309L)
+#define USE_CLOCK_GETTIME
+#endif
+
 /*--------------------------------------------------
  * osl_getSystemTime
  *-------------------------------------------------*/
@@ -40,7 +46,7 @@
 sal_Bool SAL_CALL osl_getSystemTime(TimeValue* tv)
 {
     int res;
-#if defined(LINUX)
+#if defined(USE_CLOCK_GETTIME)
     struct timespec tp;
 
     res = clock_gettime(CLOCK_REALTIME, &tp);
@@ -56,7 +62,7 @@
     }
 
     tv->Seconds = tp.tv_sec;
-    #if defined(LINUX)
+    #if defined(USE_CLOCK_GETTIME)
     tv->Nanosec = tp.tv_nsec;
     #else
     tv->Nanosec = tp.tv_usec * 1000;

-- 
To view, visit https://gerrit.libreoffice.org/3889
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I12809d970d0a2a4ebb946675f904832ff37e029f
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Arnaud Versini <arnaud.versini@gmail.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.