diff --git a/newlib/ChangeLog b/newlib/ChangeLog index f3bb3db4e..072c832fe 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,12 @@ +2012-07-06 Corinna Vinschen + + 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 * doc/Makefile.am (makedoc): Use LDFLAGS_FOR_BUILD not LDFLAGS. diff --git a/newlib/libc/include/sys/time.h b/newlib/libc/include/sys/time.h index d48839f6e..3c9bf771b 100644 --- a/newlib/libc/include/sys/time.h +++ b/newlib/libc/include/sys/time.h @@ -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 #endif /* __CYGWIN__ */ -#endif /* _WINSOCK_H */ +#endif /* !_TIMEVAL_DEFINED */ #define ITIMER_REAL 0 #define ITIMER_VIRTUAL 1 diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h index 73e4ed878..ba24929f3 100644 --- a/newlib/libc/include/sys/types.h +++ b/newlib/libc/include/sys/types.h @@ -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 diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h index 6bae77483..a5f66c0b7 100644 --- a/newlib/libc/include/sys/unistd.h +++ b/newlib/libc/include/sys/unistd.h @@ -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