diff options
author | Thomas Quinot <quinot@adacore.com> | 2005-09-05 09:50:26 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2005-09-05 09:50:26 +0200 |
commit | 826757551170eec3ec794d961b5b6dc24d1244cd (patch) | |
tree | ae1698c6bf9c081f3fb4cdc10113b63b9801baf6 /gcc/ada/gsocket.h | |
parent | b9260c3d60418dd0e549bbdb69c8f696a76d5106 (diff) | |
download | gcc-826757551170eec3ec794d961b5b6dc24d1244cd.zip gcc-826757551170eec3ec794d961b5b6dc24d1244cd.tar.gz gcc-826757551170eec3ec794d961b5b6dc24d1244cd.tar.bz2 |
g-soccon-vms.adb: Renamed to g-soccon-vms.ads
2005-09-01 Thomas Quinot <quinot@adacore.com>
* g-soccon-vms.adb: Renamed to g-soccon-vms.ads
* g-soccon-vms.ads: Renamed from g-soccon-vms.adb
* g-soccon.ads, g-soccon-tru64.ads, g-soccon-aix.ads,
g-soccon-darwin.ads, g-soccon-irix.ads, g-soccon-hpux.ads,
g-soccon-solaris.ads, g-soccon-mingw.ads, g-soccon-vxworks.ads,
g-soccon-freebsd.ads: Add new constants:
IP_MULTICAST_IF
SO_RCVTIMEO/SO_SNDTIMEO
IOV_MAX
* gen-soccon.c:
Move all target-specific file inclusions and macro definitions to
gsocket.h, in order to ensure that any C code in socket.c will see a
set of constants that is consistent with the contents of g-soccon.ads.
* gsocket.h: Code imported from gen-soccon.c:
Move all target-specific file inclusions and macro definitions to
gsocket.h, in order to ensure that any C code in socket.c will see a set
of constants that is consistent with the contents of g-soccon.ads.
This change also makes gen-soccon self-contained (removing dependencies
upon GCC internal headers).
* g-socket.adb (Send_Vector): Make calls to Writev at most IOV_MAX
iovecs at a time.
(To_Inet_Addr): Now a procedure instead of a function, more efficient.
* socket.c: Minor reformatting.
From-SVN: r103853
Diffstat (limited to 'gcc/ada/gsocket.h')
-rw-r--r-- | gcc/ada/gsocket.h | 115 |
1 files changed, 96 insertions, 19 deletions
diff --git a/gcc/ada/gsocket.h b/gcc/ada/gsocket.h index 9b6ecf2..f593acf 100644 --- a/gcc/ada/gsocket.h +++ b/gcc/ada/gsocket.h @@ -2,7 +2,7 @@ * * * GNAT COMPILER COMPONENTS * * * - * S O C K E T * + * G S O C K E T * * * * C Header File * * * @@ -30,38 +30,115 @@ * * ****************************************************************************/ -#ifdef __vxworks -#include "vxWorks.h" +#ifndef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED 1 +/* For HP-UX */ #endif -#ifdef IN_RTS -#include "tconfig.h" -#include "tsystem.h" +#ifndef BSD_COMP +#define BSD_COMP 1 +/* For Solaris */ +#endif + +#ifndef _ALL_SOURCE +#define _ALL_SOURCE 1 +/* For AIX */ +#endif + +#ifndef _OSF_SOURCE +#define _OSF_SOURCE 1 +/* For Tru64 */ +#endif + +#include <limits.h> -#if defined (WINNT) +#if defined(__vxworks) +#include <vxWorks.h> +#include <ioLib.h> +#define SHUT_RD 0 +#define SHUT_WR 1 +#define SHUT_RDWR 2 + +#elif defined (WINNT) #define FD_SETSIZE 1024 #include <windows.h> #ifdef __MINGW32__ -#include "mingw32.h" -#if STD_MINGW -#include <winsock.h> -#else -#include <windows32/sockets.h> +#include <winsock2.h> +#include <ws2tcpip.h> + +#define EACCES WSAEACCES +#define EADDRINUSE WSAEADDRINUSE +#define EADDRNOTAVAIL WSAEADDRNOTAVAIL +#define EAFNOSUPPORT WSAEAFNOSUPPORT +#define EALREADY WSAEALREADY +#define EBADF WSAEBADF +#define ECONNABORTED WSAECONNABORTED +#define ECONNREFUSED WSAECONNREFUSED +#define ECONNRESET WSAECONNRESET +#define EDESTADDRREQ WSAEDESTADDRREQ +#define EFAULT WSAEFAULT +#define EHOSTDOWN WSAEHOSTDOWN +#define EHOSTUNREACH WSAEHOSTUNREACH +#define EINPROGRESS WSAEINPROGRESS +#define EINTR WSAEINTR +#define EINVAL WSAEINVAL +#define EIO WSAEDISCON +#define EISCONN WSAEISCONN +#define ELOOP WSAELOOP +#define EMFILE WSAEMFILE +#define EMSGSIZE WSAEMSGSIZE +#define ENAMETOOLONG WSAENAMETOOLONG +#define ENETDOWN WSAENETDOWN +#define ENETRESET WSAENETRESET +#define ENETUNREACH WSAENETUNREACH +#define ENOBUFS WSAENOBUFS +#define ENOPROTOOPT WSAENOPROTOOPT +#define ENOTCONN WSAENOTCONN +#define ENOTSOCK WSAENOTSOCK +#define EOPNOTSUPP WSAEOPNOTSUPP +#define EPFNOSUPPORT WSAEPFNOSUPPORT +#define EPROTONOSUPPORT WSAEPROTONOSUPPORT +#define ENOTSOCK WSAENOTSOCK +#define EOPNOTSUPP WSAEOPNOTSUPP +#define EPFNOSUPPORT WSAEPFNOSUPPORT +#define EPROTONOSUPPORT WSAEPROTONOSUPPORT +#define EPROTOTYPE WSAEPROTOTYPE +#define ESHUTDOWN WSAESHUTDOWN +#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT +#define ETIMEDOUT WSAETIMEDOUT +#define ETOOMANYREFS WSAETOOMANYREFS +#define EWOULDBLOCK WSAEWOULDBLOCK +#define SHUT_RD SD_RECEIVE +#define SHUT_WR SD_SEND +#define SHUT_RDWR SD_BOTH + #endif + +#elif defined(VMS) +#define FD_SETSIZE 4096 +#ifndef IN_RTS +/* These DEC C headers are not available when building with GCC */ +#include <in.h> +#include <tcp.h> +#include <ioctl.h> +#include <netdb.h> #endif + #endif -#if defined (VMS) -#define FD_SETSIZE 4096 -#include <sys/time.h> +#ifndef __MINGW32__ +#include <errno.h> #endif -#else -#include "config.h" -#include "system.h" +#ifndef __vxworks +#include <sys/time.h> #endif #if !(defined (VMS) || defined (__MINGW32__) || defined(__rtems__)) -# include <sys/socket.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <netinet/tcp.h> +#include <sys/ioctl.h> +#include <netdb.h> #endif |