From 3f7b89caf1a04a8e5472866c575eb019e69a019d Mon Sep 17 00:00:00 2001 From: Danny Smith Date: Thu, 12 Sep 2002 10:11:05 +0000 Subject: [PATCH] * include/winsock.h (timeval): Guard struct and associated macros with _TIMEVAL_DEFINED. * include/winsock2.h (timeval): Likewise. --- winsup/w32api/ChangeLog | 6 ++++++ winsup/w32api/include/winsock.h | 15 +++++++++------ winsup/w32api/include/winsock2.h | 15 +++++++++------ 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/winsup/w32api/ChangeLog b/winsup/w32api/ChangeLog index ac6644d4c..95f968326 100644 --- a/winsup/w32api/ChangeLog +++ b/winsup/w32api/ChangeLog @@ -1,3 +1,9 @@ +2002-09-12 Danny Smith + + * include/winsock.h (timeval): Guard struct and associated + macros with _TIMEVAL_DEFINED. + * include/winsock2.h (timeval): Likewise. + 2002-09-11 Danny Smith * lib/shell32.def (SHBindtoParent,SHCreateDirectoryEx[AW], diff --git a/winsup/w32api/include/winsock.h b/winsup/w32api/include/winsock.h index de9f08023..852fcd8b1 100644 --- a/winsup/w32api/include/winsock.h +++ b/winsup/w32api/include/winsock.h @@ -83,10 +83,19 @@ for (__i = 0; __i < ((fd_set *)(set))->fd_count ; __i++) {\ #endif /* ndef _SYS_TYPES_FD_SET */ #if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__)) +#ifndef _TIMEVAL_DEFINED /* also in sys/time.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 */ struct hostent { char *h_name; char **h_aliases; @@ -99,12 +108,6 @@ struct linger { u_short l_onoff; u_short l_linger; }; -#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 /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */ #define IOCPARM_MASK 0x7f #define IOC_VOID 0x20000000 diff --git a/winsup/w32api/include/winsock2.h b/winsup/w32api/include/winsock2.h index dc01627cb..20c3fab3e 100644 --- a/winsup/w32api/include/winsock2.h +++ b/winsup/w32api/include/winsock2.h @@ -96,10 +96,19 @@ if (__i == ((fd_set *)(set))->fd_count) {\ This may cause runtime problems with W32 sockets" #endif /* ndef _SYS_TYPES_FD_SET */ #if !(defined (__INSIDE_CYGWIN__) || (__INSIDE_MSYS__)) +#ifndef _TIMEVAL_DEFINED /* also in sys/time.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 */ struct hostent { char *h_name; char **h_aliases; @@ -112,12 +121,6 @@ struct linger { u_short l_onoff; u_short l_linger; }; -#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 /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */ #define IOCPARM_MASK 0x7f #define IOC_VOID 0x20000000