2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER within this package.
16 #ifndef __STRICT_ANSI__
17 #ifndef _TIMEVAL_DEFINED /* also in winsock[2].h */
18 #define _TIMEVAL_DEFINED
23 #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
24 #define timercmp(tvp, uvp, cmp) \
25 (((tvp)->tv_sec != (uvp)->tv_sec) ? \
26 ((tvp)->tv_sec cmp (uvp)->tv_sec) : \
27 ((tvp)->tv_usec cmp (uvp)->tv_usec))
28 #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
29 #endif /* _TIMEVAL_DEFINED */
31 #ifndef _TIMEZONE_DEFINED /* also in sys/time.h */
32 #define _TIMEZONE_DEFINED
33 /* Provided for compatibility with code that assumes that
34 the presence of gettimeofday function implies a definition
35 of struct timezone. */
38 int tz_minuteswest
; /* of Greenwich */
39 int tz_dsttime
; /* type of dst correction to apply */
42 extern int __cdecl
mingw_gettimeofday (struct timeval
*p
, struct timezone
*z
);
47 Implementation as per:
48 The Open Group Base Specifications, Issue 6
49 IEEE Std 1003.1, 2004 Edition
51 The timezone pointer arg is ignored. Errors are ignored.
53 #ifndef _GETTIMEOFDAY_DEFINED
54 #define _GETTIMEOFDAY_DEFINED
55 int __cdecl
gettimeofday(struct timeval
*__restrict__
,
56 void *__restrict__
/* tzp (unused) */);
59 #endif /* __STRICT_ANSI__ */
65 /* Adding timespec definition. */
66 #include <sys/timeb.h>
69 #endif /* _SYS_TIME_H_ */