]> code.delx.au - gnu-emacs/blobdiff - nt/inc/sys/time.h
Fix incompatibilities between MinGW.org and MinGW64 headers
[gnu-emacs] / nt / inc / sys / time.h
index c90d1fd62f542fe98e26b8a93f25f3ef93936a07..e49f0ea4de3b3a433028480d603e79da4140d890 100644 (file)
@@ -2,22 +2,39 @@
 #define SYS_TIME_H_INCLUDED
 
 /*
- * sys/time.h doesn't exist on NT
+ * sys/time.h either doesn't exist on Windows, or doesn't necessarily
+ * have the below stuff.
  */
 
 struct timeval
-  {
-    long tv_sec;       /* seconds */
-    long tv_usec;      /* microseconds */
-  };
+{
+  long         tv_sec;         /* seconds */
+  long         tv_usec;        /* microseconds */
+};
+
 struct timezone
-  {
-    int        tz_minuteswest; /* minutes west of Greenwich */
-    int        tz_dsttime;     /* type of dst correction */
-  };
+{
+  int          tz_minuteswest; /* minutes west of Greenwich */
+  int          tz_dsttime;     /* type of dst correction */
+};
 
 void gettimeofday (struct timeval *, struct timezone *);
 
+#define ITIMER_REAL      0
+#define ITIMER_PROF      1
+
+/* MinGW64 defines 'struct itimerval' and _TIMESPEC_DEFINED in sys/types.h.  */
+#ifndef _TIMESPEC_DEFINED
+struct itimerval
+{
+  struct  timeval it_interval; /* timer interval */
+  struct  timeval it_value;    /* current value */
+};
+#endif
+
+int getitimer (int, struct itimerval *);
+int setitimer (int, struct itimerval *, struct itimerval *);
+
 #endif /* SYS_TIME_H_INCLUDED */
 
 /* end of sys/time.h */