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:
Corinna Vinschen 2012-07-06 10:41:21 +00:00
parent 0390476c47
commit 0246baaea2
4 changed files with 14 additions and 5 deletions

View File

@ -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>
* doc/Makefile.am (makedoc): Use LDFLAGS_FOR_BUILD not LDFLAGS.

View File

@ -12,7 +12,7 @@
extern "C" {
#endif
#ifndef _WINSOCK_H
#ifndef _TIMEVAL_DEFINED
#define _TIMEVAL_DEFINED
struct timeval {
time_t tv_sec;
@ -28,7 +28,7 @@ struct timezone {
#include <cygwin/sys_time.h>
#endif /* __CYGWIN__ */
#endif /* _WINSOCK_H */
#endif /* !_TIMEVAL_DEFINED */
#define ITIMER_REAL 0
#define ITIMER_VIRTUAL 1

View File

@ -210,7 +210,7 @@ typedef unsigned short nlink_t;
includes the W32api winsock[2].h header must know what it is doing;
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 NBBY 8 /* number of bits in a byte */
/*
@ -247,7 +247,7 @@ typedef struct _types_fd_set {
*__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 _ST_INT32

View File

@ -233,7 +233,7 @@ int _EXFUN(truncate, (const char *, off_t __length));
int _EXFUN(getdtablesize, (void));
int _EXFUN(setdtablesize, (int));
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 */
int _EXFUN(gethostname, (char *__name, size_t __len));
#endif