diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2002-09-12 10:11:05 +0000 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2002-09-12 10:11:05 +0000 |
commit | 3f7b89caf1a04a8e5472866c575eb019e69a019d (patch) | |
tree | 70d6f0f79f6e6d9ddbb96791df3b80c882bb85b6 /winsup/w32api/include/winsock2.h | |
parent | a861509239a6cfb34f6de319135ef0ed3837a5f8 (diff) | |
download | newlib-3f7b89caf1a04a8e5472866c575eb019e69a019d.zip newlib-3f7b89caf1a04a8e5472866c575eb019e69a019d.tar.gz newlib-3f7b89caf1a04a8e5472866c575eb019e69a019d.tar.bz2 |
* include/winsock.h (timeval): Guard struct and associated
macros with _TIMEVAL_DEFINED.
* include/winsock2.h (timeval): Likewise.
Diffstat (limited to 'winsup/w32api/include/winsock2.h')
-rw-r--r-- | winsup/w32api/include/winsock2.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/winsup/w32api/include/winsock2.h b/winsup/w32api/include/winsock2.h index dc01627..20c3fab 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 |