]> code.delx.au - gnu-emacs/blobdiff - nt/inc/sys/time.h
Merge from trunk and resolve conflicts.
[gnu-emacs] / nt / inc / sys / time.h
index 80c725385bb31e252a304acbf9126b5fd2c1ed55..aa51041bcd806d32ac692c832001752e068ec03a 100644 (file)
@@ -9,12 +9,23 @@
 /* The guards are for MinGW64, which defines these structs on its
    system headers which are included by ms-w32.h.  */
 #ifndef _W64
+/* Allow inclusion of sys/time.h and winsock2.h in any order.  Needed
+   for running the configure test, which is only relevant to MinGW.  */
+#ifndef _TIMEVAL_DEFINED
+#define _TIMEVAL_DEFINED
 struct timeval
 {
   long         tv_sec;         /* seconds */
   long         tv_usec;        /* microseconds */
 };
-#endif
+#define timerisset(tvp)  ((tvp)->tv_sec || (tvp)->tv_usec)
+#define timercmp(tvp, uvp, cmp) \
+        (((tvp)->tv_sec != (uvp)->tv_sec) ? \
+        ((tvp)->tv_sec cmp (uvp)->tv_sec) : \
+        ((tvp)->tv_usec cmp (uvp)->tv_usec))
+#define timerclear(tvp)  (tvp)->tv_sec = (tvp)->tv_usec = 0
+#endif /* _TIMEVAL_DEFINED */
+#endif /* _W64 */
 
 #ifndef _TIMEZONE_DEFINED
 struct timezone