From: Joel Sherrill Date: Tue, 12 Aug 2014 19:49:22 +0000 (+0000) Subject: socket.c: For RTEMS, use correct prototype of gethostbyname_r(). X-Git-Tag: releases/gcc-4.8.4~293 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=643290b881c70bf11323d65063c4eb3a15744ed7;p=thirdparty%2Fgcc.git socket.c: For RTEMS, use correct prototype of gethostbyname_r(). 2014-08-12 Joel Sherrill * socket.c: For RTEMS, use correct prototype of gethostbyname_r(). * gsocket.h Add include of on RTEMS. From-SVN: r213883 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 5a4872d6b718..a430c4b36d4c 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2014-08-12 Joel Sherrill + + * socket.c: For RTEMS, use correct prototype of gethostbyname_r(). + * gsocket.h Add include of on RTEMS. + 2014-08-11 Joel Sherrill * s-osinte-rtems.adb: Correct formatting of line in license block. diff --git a/gcc/ada/gsocket.h b/gcc/ada/gsocket.h index e21d7142701f..1d9235f4ad82 100644 --- a/gcc/ada/gsocket.h +++ b/gcc/ada/gsocket.h @@ -183,6 +183,11 @@ #include #endif +#if defined(__rtems__) +#include +/* Required, for read(), write(), and close() */ +#endif + /* * RTEMS has these .h files but not until you have built and installed RTEMS. * When building a C/C++ toolset, you also build the newlib C library, so the diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c index 18999b394ea5..e65845628a1d 100644 --- a/gcc/ada/socket.c +++ b/gcc/ada/socket.c @@ -212,7 +212,7 @@ __gnat_gethostbyname (const char *name, struct hostent *rh; int ri; -#if defined(__linux__) || defined(__GLIBC__) +#if defined(__linux__) || defined(__GLIBC__) || defined(__rtems__) (void) gethostbyname_r (name, ret, buf, buflen, &rh, h_errnop); #else rh = gethostbyname_r (name, ret, buf, buflen, h_errnop);