Navit SVN

/work/compile/navit/src/navit/support/libc/sys/time.h

00001 #ifndef _SYS_TIME_H_
00002 #define _SYS_TIME_H_
00003 #include <time.h>
00004 
00005 #ifdef  __cplusplus
00006 extern "C" {
00007 #endif
00008 
00009 #ifndef _TIMEVAL_DEFINED /* also in winsock[2].h */
00010 #define _TIMEVAL_DEFINED
00011 struct timeval {
00012   long tv_sec;
00013   long tv_usec;
00014 };
00015 #define timerisset(tvp)  ((tvp)->tv_sec || (tvp)->tv_usec)
00016 #define timercmp(tvp, uvp, cmp) \
00017         (((tvp)->tv_sec != (uvp)->tv_sec) ? \
00018         ((tvp)->tv_sec cmp (uvp)->tv_sec) : \
00019         ((tvp)->tv_usec cmp (uvp)->tv_usec))
00020 #define timerclear(tvp)  (tvp)->tv_sec = (tvp)->tv_usec = 0
00021 #endif /* _TIMEVAL_DEFINED */
00022 
00023 /* Provided for compatibility with code that assumes that
00024    the presence of gettimeofday function implies a definition
00025    of struct timezone. */
00026 #ifndef _TIMEZONE_DEFINED
00027 struct timezone
00028 {
00029   int tz_minuteswest; /* of Greenwich */
00030   int tz_dsttime;     /* type of dst correction to apply */
00031 };
00032 #define _TIMEZONE_DEFINED
00033 #endif
00034 
00035 /*
00036    Implementation as per:
00037    The Open Group Base Specifications, Issue 6
00038    IEEE Std 1003.1, 2004 Edition
00039 
00040    The timezone pointer arg is ignored.  Errors are ignored.
00041 */ 
00042 
00043 #if 0
00044 #define __restrict__
00045 int __cdecl __MINGW_NOTHROW gettimeofday(struct timeval *__restrict__,
00046                          void *__restrict__  /* tzp (unused) */);
00047 #else
00048 int gettimeofday(struct timeval *, void *);
00049 #endif
00050 
00051 #ifdef  __cplusplus
00052 }
00053 #endif
00054 
00055 
00056 #endif /* _SYS_TIME_H_ */