From 139b31f7acdd2edffed8994e4ea1468b80cac8a6 Mon Sep 17 00:00:00 2001 From: Danny Smith Date: Thu, 12 Sep 2002 10:34:54 +0000 Subject: [PATCH] * include/sys/time.h (timeval): Add struct definition and associated macros (copied from w32api/include/winsock.h). --- winsup/mingw/ChangeLog | 5 +++++ winsup/mingw/include/sys/time.h | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index f43b0ffdc..72e95e824 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,3 +1,8 @@ +2002-09-12 Danny Smith + + * include/sys/time.h (timeval): Add struct definition and + associated macros (copied from w32api/include/winsock.h). + 2002-09-05 Earnie Boyd * include/_mingw.h: Increment version to 2.3. diff --git a/winsup/mingw/include/sys/time.h b/winsup/mingw/include/sys/time.h index 39d85f67b..dfa35d18b 100644 --- a/winsup/mingw/include/sys/time.h +++ b/winsup/mingw/include/sys/time.h @@ -1,3 +1,19 @@ #include +#ifndef __STRICT_ANSI__ +#ifndef _TIMEVAL_DEFINED /* also in winsock[2].h */ +#define _TIMEVAL_DEFINED +struct timeval { + long tv_sec; + long tv_usec; +}; +#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 /* __STRICT_ANSI__ */