* include/winsock.h (_SYS_TYPES_H macro guard for int types): Remove; use only
_BSDTYPES_DEFINED macro now defined in newlib sys/types.h. (SYS_TYPES_H macro guard for fd_set): Replace with_SYS_TYPES_FD_SET macro now defined in newlib sys/types.h. Emit warning if defined. * include/winsock2.h: Ditto. * include/windows.h (Win32_Winsock): Replace with new macros __USE_W32_SOCKETS and warn of deprecation.
This commit is contained in:
@ -17,14 +17,14 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined ( _BSDTYPES_DEFINED ) && !defined ( _SYS_TYPES_H )
|
||||
#if !defined ( _BSDTYPES_DEFINED )
|
||||
/* also defined in gmon.h and in cygwin's sys/types */
|
||||
typedef unsigned char u_char;
|
||||
typedef unsigned short u_short;
|
||||
typedef unsigned int u_int;
|
||||
typedef unsigned long u_long;
|
||||
#define _BSDTYPES_DEFINED
|
||||
#endif /* ndef _BSDTYPES_ _SYS_TYPES_H */
|
||||
#endif /* !defined _BSDTYPES_DEFINED */
|
||||
typedef u_int SOCKET;
|
||||
#ifndef FD_SETSIZE
|
||||
#define FD_SETSIZE 64
|
||||
@ -35,8 +35,10 @@ typedef u_int SOCKET;
|
||||
#define SD_SEND 0x01
|
||||
#define SD_BOTH 0x02
|
||||
|
||||
#ifndef _SYS_TYPES_H
|
||||
/* fd_set may have been defined by the newlib <sys/types.h>. */
|
||||
#ifndef _SYS_TYPES_FD_SET
|
||||
/* fd_set may have be defined by the newlib <sys/types.h>
|
||||
* if __USE_W32_SOCKETS not defined.
|
||||
*/
|
||||
#ifdef fd_set
|
||||
#undef fd_set
|
||||
#endif
|
||||
@ -71,7 +73,11 @@ for (__i = 0; __i < ((fd_set *)(set))->fd_count ; __i++) {\
|
||||
#ifndef FD_ISSET
|
||||
#define FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)(fd), (fd_set *)(set))
|
||||
#endif
|
||||
#endif /* ndef _SYS_TYPES_H */
|
||||
#elif !defined(USE_SYS_TYPES_FD_SET)
|
||||
#warning "fd_set and associated macros have been defined in sys/types. \
|
||||
This can cause runtime problems with W32 sockets"
|
||||
#endif /* ndef _SYS_TYPES_FD_SET */
|
||||
|
||||
#ifndef __INSIDE_CYGWIN__
|
||||
struct timeval {
|
||||
long tv_sec;
|
||||
|
Reference in New Issue
Block a user