diff options
author | Christopher Faylor <me@cgf.cx> | 2001-03-20 19:27:56 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-03-20 19:27:56 +0000 |
commit | d17d6d4286c18626c357d748df6fa9ab66aa2714 (patch) | |
tree | 63521304e418ff5de6351a049292073fa308ce02 | |
parent | dac9c6045fda7356cb50e0168f859dbbbf8d2c35 (diff) | |
download | newlib-d17d6d4286c18626c357d748df6fa9ab66aa2714.zip newlib-d17d6d4286c18626c357d748df6fa9ab66aa2714.tar.gz newlib-d17d6d4286c18626c357d748df6fa9ab66aa2714.tar.bz2 |
* libc/include/sys/types.h (BSD int typedefs): Guard with _BSDTYPES_DEFINED
rather than _WINSOCK_H.
(fd_set): Add !defined __USE_W32_SOCKETS to guard; define _SYS_TYPES_FD_SET.
* libc/include/sys/unistd.h (gethostname): Don't declare if defined
(_WINSOCK_H) || defined (__USE_W32_SOCKETS).
-rw-r--r-- | newlib/ChangeLog | 9 | ||||
-rw-r--r-- | newlib/libc/include/sys/types.h | 20 | ||||
-rw-r--r-- | newlib/libc/include/sys/unistd.h | 5 |
3 files changed, 25 insertions, 9 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 1768d47..e448368 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,12 @@ +2001-03-20 Danny Smith <dannysmith@users.sourceforge.net> + + * libc/include/sys/types.h (BSD int typedefs): Guard with + _BSDTYPES_DEFINED rather than _WINSOCK_H. + (fd_set): Add !defined __USE_W32_SOCKETS to guard; define + _SYS_TYPES_FD_SET. + * libc/include/sys/unistd.h (gethostname): Don't declare if defined + (_WINSOCK_H) || defined (__USE_W32_SOCKETS). + Sat Mar 17 18:30:00 2001 Corinna Vinschen <corinna@vinschen.de> * libc/include/sys/unistd.h: Add _PC_POSIX_PERMISSONS and diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h index d37a5f9..7ec35ae 100644 --- a/newlib/libc/include/sys/types.h +++ b/newlib/libc/include/sys/types.h @@ -49,11 +49,13 @@ # define physadr physadr_t # define quad quad_t -#ifndef _WINSOCK_H +#ifndef _BSDTYPES_DEFINED +/* also defined in mingw/gmon.h and in w32api/winsock[2].h */ typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; +#define _BSDTYPES_DEFINED #endif typedef unsigned short ushort; /* System V compatibility */ @@ -152,12 +154,14 @@ typedef unsigned int mode_t _ST_INT32; typedef unsigned short nlink_t; /* We don't define fd_set and friends if we are compiling POSIX - source, or if we have included the Windows Sockets.h header (which - defines Windows versions of them). Note that a program which - includes the Windows sockets.h header must know what it is doing; - it must not call the cygwin32 select function. */ -# if ! defined (_POSIX_SOURCE) && ! defined (_WINSOCK_H) - + source, or if we have included (or may include as indicated + by __USE_W32_SOCKETS) the W32api winsock[2].h header which + defines Windows versions of them. Note that a program which + 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)) +# define _SYS_TYPES_FD_SET # define NBBY 8 /* number of bits in a byte */ /* * Select uses bit masks of file descriptors in longs. @@ -193,7 +197,7 @@ typedef struct _types_fd_set { *__tmp++ = 0; \ })) -# endif /* ! defined (_POSIX_SOURCE) && ! defined (_WINSOCK_H) */ +# endif /* !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || 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 2da9879..0fad0dc 100644 --- a/newlib/libc/include/sys/unistd.h +++ b/newlib/libc/include/sys/unistd.h @@ -115,7 +115,10 @@ int _EXFUN(setdtablesize, (int)); unsigned _EXFUN(usleep, (unsigned int __useconds)); int _EXFUN(ftruncate, (int __fd, off_t __length)); int _EXFUN(truncate, (const char *, off_t __length)); -int _EXFUN(gethostname, (char *__name, size_t __len)); +#if !(defined (_WINSOCK_H) || 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 char * _EXFUN(mktemp, (char *)); int _EXFUN(sync, (void)); int _EXFUN(readlink, (const char *__path, char *__buf, int __buflen)); |