Allow building of Cygwin using Mingw64 SDK headers:
* libc/include/sys/time.h: Drop _WINSOCK_H guard. Just use _TIMEVAL_DEFINED instead. * libc/include/sys/types.h: Check for _WINSOCKAPI_ along with _WINSOCK_H. * libc/include/sys/unistd.h: Ditto.
This commit is contained in:
		| @@ -1,3 +1,12 @@ | |||||||
|  | 2012-07-06  Corinna Vinschen  <vinschen@redhat.com> | ||||||
|  |  | ||||||
|  | 	Allow building of Cygwin using Mingw64 SDK headers: | ||||||
|  | 	* libc/include/sys/time.h: Drop _WINSOCK_H guard.  Just use | ||||||
|  | 	_TIMEVAL_DEFINED instead. | ||||||
|  | 	* libc/include/sys/types.h: Check for _WINSOCKAPI_ along with | ||||||
|  | 	_WINSOCK_H. | ||||||
|  | 	* libc/include/sys/unistd.h: Ditto. | ||||||
|  |  | ||||||
| 2012-06-28  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com> | 2012-06-28  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com> | ||||||
|  |  | ||||||
| 	* doc/Makefile.am (makedoc): Use LDFLAGS_FOR_BUILD not LDFLAGS. | 	* doc/Makefile.am (makedoc): Use LDFLAGS_FOR_BUILD not LDFLAGS. | ||||||
|   | |||||||
| @@ -12,7 +12,7 @@ | |||||||
| extern "C" { | extern "C" { | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #ifndef _WINSOCK_H | #ifndef _TIMEVAL_DEFINED | ||||||
| #define _TIMEVAL_DEFINED | #define _TIMEVAL_DEFINED | ||||||
| struct timeval { | struct timeval { | ||||||
|   time_t      tv_sec; |   time_t      tv_sec; | ||||||
| @@ -28,7 +28,7 @@ struct timezone { | |||||||
| #include <cygwin/sys_time.h> | #include <cygwin/sys_time.h> | ||||||
| #endif /* __CYGWIN__ */ | #endif /* __CYGWIN__ */ | ||||||
|  |  | ||||||
| #endif /* _WINSOCK_H */ | #endif /* !_TIMEVAL_DEFINED */ | ||||||
|  |  | ||||||
| #define ITIMER_REAL     0 | #define ITIMER_REAL     0 | ||||||
| #define ITIMER_VIRTUAL  1 | #define ITIMER_VIRTUAL  1 | ||||||
|   | |||||||
| @@ -210,7 +210,7 @@ typedef unsigned short nlink_t; | |||||||
|    includes the W32api winsock[2].h header must know what it is doing; |    includes the W32api winsock[2].h header must know what it is doing; | ||||||
|    it must not call the cygwin32 select function. |    it must not call the cygwin32 select function. | ||||||
| */ | */ | ||||||
| # if !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (__USE_W32_SOCKETS))  | # if !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS))  | ||||||
| #  define _SYS_TYPES_FD_SET | #  define _SYS_TYPES_FD_SET | ||||||
| #  define	NBBY	8		/* number of bits in a byte */ | #  define	NBBY	8		/* number of bits in a byte */ | ||||||
| /* | /* | ||||||
| @@ -247,7 +247,7 @@ typedef	struct _types_fd_set { | |||||||
|        *__tmp++ = 0; \ |        *__tmp++ = 0; \ | ||||||
| })) | })) | ||||||
|  |  | ||||||
| # endif	/* !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (__USE_W32_SOCKETS)) */ | # endif	/* !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS)) */ | ||||||
|  |  | ||||||
| #undef __MS_types__ | #undef __MS_types__ | ||||||
| #undef _ST_INT32 | #undef _ST_INT32 | ||||||
|   | |||||||
| @@ -233,7 +233,7 @@ int     _EXFUN(truncate, (const char *, off_t __length)); | |||||||
| int	_EXFUN(getdtablesize, (void)); | int	_EXFUN(getdtablesize, (void)); | ||||||
| int	_EXFUN(setdtablesize, (int)); | int	_EXFUN(setdtablesize, (int)); | ||||||
| useconds_t _EXFUN(ualarm, (useconds_t __useconds, useconds_t __interval)); | useconds_t _EXFUN(ualarm, (useconds_t __useconds, useconds_t __interval)); | ||||||
| #if !(defined  (_WINSOCK_H) || defined (__USE_W32_SOCKETS)) | #if !(defined  (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS)) | ||||||
| /* winsock[2].h defines as __stdcall, and with int as 2nd arg */ | /* winsock[2].h defines as __stdcall, and with int as 2nd arg */ | ||||||
|  int	_EXFUN(gethostname, (char *__name, size_t __len)); |  int	_EXFUN(gethostname, (char *__name, size_t __len)); | ||||||
| #endif | #endif | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user