Merge from trunk and resolve conflicts.
[bpt/emacs.git] / nt / inc / sys / time.h
1 #ifndef SYS_TIME_H_INCLUDED
2 #define SYS_TIME_H_INCLUDED
3
4 /*
5 * sys/time.h either doesn't exist on Windows, or doesn't necessarily
6 * have the below stuff.
7 */
8
9 /* The guards are for MinGW64, which defines these structs on its
10 system headers which are included by ms-w32.h. */
11 #ifndef _W64
12 /* Allow inclusion of sys/time.h and winsock2.h in any order. Needed
13 for running the configure test, which is only relevant to MinGW. */
14 #ifndef _TIMEVAL_DEFINED
15 #define _TIMEVAL_DEFINED
16 struct timeval
17 {
18 long tv_sec; /* seconds */
19 long tv_usec; /* microseconds */
20 };
21 #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
22 #define timercmp(tvp, uvp, cmp) \
23 (((tvp)->tv_sec != (uvp)->tv_sec) ? \
24 ((tvp)->tv_sec cmp (uvp)->tv_sec) : \
25 ((tvp)->tv_usec cmp (uvp)->tv_usec))
26 #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
27 #endif /* _TIMEVAL_DEFINED */
28 #endif /* _W64 */
29
30 #ifndef _TIMEZONE_DEFINED
31 struct timezone
32 {
33 int tz_minuteswest; /* minutes west of Greenwich */
34 int tz_dsttime; /* type of dst correction */
35 };
36 #endif
37
38 void gettimeofday (struct timeval *, struct timezone *);
39
40 #define ITIMER_REAL 0
41 #define ITIMER_PROF 1
42
43 struct itimerval
44 {
45 struct timeval it_interval; /* timer interval */
46 struct timeval it_value; /* current value */
47 };
48
49 int getitimer (int, struct itimerval *);
50 int setitimer (int, struct itimerval *, struct itimerval *);
51
52 #endif /* SYS_TIME_H_INCLUDED */
53
54 /* end of sys/time.h */
55