From 826757551170eec3ec794d961b5b6dc24d1244cd Mon Sep 17 00:00:00 2001 From: Thomas Quinot Date: Mon, 5 Sep 2005 09:50:26 +0200 Subject: g-soccon-vms.adb: Renamed to g-soccon-vms.ads 2005-09-01 Thomas Quinot * 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 --- gcc/ada/gsocket.h | 115 +++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 96 insertions(+), 19 deletions(-) (limited to 'gcc/ada/gsocket.h') 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 -#if defined (WINNT) +#if defined(__vxworks) +#include +#include +#define SHUT_RD 0 +#define SHUT_WR 1 +#define SHUT_RDWR 2 + +#elif defined (WINNT) #define FD_SETSIZE 1024 #include #ifdef __MINGW32__ -#include "mingw32.h" -#if STD_MINGW -#include -#else -#include +#include +#include + +#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 +#include +#include +#include #endif + #endif -#if defined (VMS) -#define FD_SETSIZE 4096 -#include +#ifndef __MINGW32__ +#include #endif -#else -#include "config.h" -#include "system.h" +#ifndef __vxworks +#include #endif #if !(defined (VMS) || defined (__MINGW32__) || defined(__rtems__)) -# include +#include +#include +#include +#include +#include #endif -- cgit v1.1