diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-06-14 14:39:55 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-06-14 14:39:55 +0200 |
commit | 4a214958d18269588e382f1a39c6d5612f37365c (patch) | |
tree | a0154a432838c9ab26b6f1434eabfeddc95a92d8 /gcc/ada/gsocket.h | |
parent | 5bca794b0df69689d0bcc6d03697f169e543dd2c (diff) | |
download | gcc-4a214958d18269588e382f1a39c6d5612f37365c.zip gcc-4a214958d18269588e382f1a39c6d5612f37365c.tar.gz gcc-4a214958d18269588e382f1a39c6d5612f37365c.tar.bz2 |
[multiple changes]
2010-06-14 Ed Schonberg <schonberg@adacore.com>
* sem_ch8.adb (End_Use_Type): Before indicating that an operator is not
use-visible, check whether it is a primitive for more than one type.
2010-06-14 Robert Dewar <dewar@adacore.com>
* sem_ch3.adb (Copy_And_Swap): Copy Has_Pragma_Unmodified flag.
* sem_ch7.adb (Preserve_Full_Attributes): Preserve
Has_Pragma_Unmodified flag.
2010-06-14 Thomas Quinot <quinot@adacore.com>
* g-sttsne-locking.adb, g-sttsne-locking.ads, g-sttsne.ads,
g-sttsne-vxworks.adb, g-sttsne-dummy.ads: Removed. Mutual exclusion is
now done in GNAT.Sockets if necessary.
* gsocket.h, g-socket.adb, g-sothco.ads (GNAT.Sockets.Get_XXX_By_YYY):
Ensure mutual exclusion for netdb operations if the target platform
requires it.
(GNAT.Sockets.Thin_Common): New binding for getXXXbyYYY, treating struct
hostent as an opaque type to improve portability.
* s-oscons-tmplt.c, socket.c: For the case of Vxworks, emulate
gethostbyYYY using proprietary VxWorks API so that a uniform interface
is available for the Ada side.
* gcc-interface/Makefile.in: Remove g-sttsne-*
* gcc-interface/Make-lang.in: Update dependencies.
2010-06-14 Vincent Celier <celier@adacore.com>
* gnatcmd.adb (Mapping_File): New function.
From-SVN: r160731
Diffstat (limited to 'gcc/ada/gsocket.h')
-rw-r--r-- | gcc/ada/gsocket.h | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/gcc/ada/gsocket.h b/gcc/ada/gsocket.h index a8e6faa..7763b18 100644 --- a/gcc/ada/gsocket.h +++ b/gcc/ada/gsocket.h @@ -194,34 +194,37 @@ #include <netdb.h> #endif -/* - * Handling of gethostbyname, gethostbyaddr, getservbyname and getservbyport - * ========================================================================= - * - * The default implementation of GNAT.Sockets.Thin requires that these - * operations be either thread safe, or that a reentrant version getXXXbyYYY_r - * be provided. In both cases, socket.c provides a __gnat_safe_getXXXbyYYY - * function with the same signature as getXXXbyYYY_r. If the operating - * system version of getXXXbyYYY is thread safe, the provided auxiliary - * buffer argument is unused and ignored. - * - * Target specific versions of GNAT.Sockets.Thin for platforms that can't - * fulfill these requirements must provide their own protection mechanism - * in Safe_GetXXXbyYYY, and if they require GNAT.Sockets to provide a buffer - * to this effect, then we need to set Need_Netdb_Buffer here (case of - * VxWorks and VMS). - */ - -#if defined (_AIX) || defined (__FreeBSD__) || defined (__hpux__) || defined (__osf__) || defined (_WIN32) || defined (__APPLE__) +#if defined (_AIX) || defined (__FreeBSD__) || defined (__hpux__) || \ + defined (__osf__) || defined (_WIN32) || defined (__APPLE__) # define HAVE_THREAD_SAFE_GETxxxBYyyy 1 -#elif defined (sgi) || defined (linux) || defined (__GLIBC__) || (defined (sun) && defined (__SVR4) && !defined (__vxworks)) || defined(__rtems__) + +#elif defined (sgi) || defined (linux) || defined (__GLIBC__) || \ + (defined (sun) && defined (__SVR4) && !defined (__vxworks)) || \ + defined(__rtems__) # define HAVE_GETxxxBYyyy_R 1 #endif -#if defined (HAVE_GETxxxBYyyy_R) || !defined (HAVE_THREAD_SAFE_GETxxxBYyyy) +/* + * Properties of the unerlying NetDB library: + * Need_Netdb_Buffer __gnat_getXXXbyYYY expects a caller-supplied buffer + * Need_Netdb_Lock __gnat_getXXXbyYYY expects the caller to ensure + * mutual exclusion + * + * See "Handling of gethostbyname, gethostbyaddr, getservbyname and + * getservbyport" in socket.c for details. + */ + +#if defined (HAVE_GETxxxBYyyy_R) # define Need_Netdb_Buffer 1 +# define Need_Netdb_Lock 0 + #else # define Need_Netdb_Buffer 0 +# if !defined (HAVE_THREAD_SAFE_GETxxxBYyyy) +# define Need_Netdb_Lock 1 +# else +# define Need_Netdb_Lock 0 +# endif #endif #if defined (__FreeBSD__) || defined (__vxworks) || defined(__rtems__) |