[pisa-src] r2191 - trunk/libpisa/sysdep.h

  • From: Mircea Gherzan <mircea.gherzan@xxxxxxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Sun, 21 Mar 2010 13:19:38 +0100

Author: gherzan
Date: Sun Mar 21 13:19:38 2010
New Revision: 2191

Log:
libpisa: better CLOCK_REALTIME redefinition

POSIX states that this _macro_ must be declared in <time.h>.
So... include this header. However, it the platform is *that* faulty,
we define the macro to the value used in glibc.

Modified:
   trunk/libpisa/sysdep.h

Modified: trunk/libpisa/sysdep.h
==============================================================================
--- trunk/libpisa/sysdep.h      Sun Mar 21 13:13:50 2010        (r2190)
+++ trunk/libpisa/sysdep.h      Sun Mar 21 13:19:38 2010        (r2191)
@@ -19,10 +19,13 @@
 
 #ifndef HAVE_CLOCK_GETTIME
 
+#include <time.h>
 #include <errno.h>
 #include <sys/time.h>
 
-#define CLOCK_REALTIME  1
+#ifndef CLOCK_REALTIME
+# define CLOCK_REALTIME  0
+#endif
 
 /**
  * Retrieve the time from a specific system clock

Other related posts:

  • » [pisa-src] r2191 - trunk/libpisa/sysdep.h - Mircea Gherzan