2014-08-12 Joel Sherrill <joel.sherrill@oarcorp.com>
authorjoel <joel@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Aug 2014 19:49:26 +0000 (19:49 +0000)
committerjoel <joel@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Aug 2014 19:49:26 +0000 (19:49 +0000)
* socket.c: For RTEMS, use correct prototype of gethostbyname_r().
* gsocket.h Add include of <unistd.h> on RTEMS.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213884 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/gsocket.h
gcc/ada/socket.c

index f7d1775..10c05a2 100644 (file)
@@ -1,3 +1,8 @@
+2014-08-12  Joel Sherrill <joel.sherrill@oarcorp.com>
+
+       * socket.c: For RTEMS, use correct prototype of gethostbyname_r().
+       * gsocket.h Add include of <unistd.h> on RTEMS.
+
 2014-08-11  Joel Sherrill <joel.sherrill@oarcorp.com>
 
        * s-osinte-rtems.adb: Correct formatting of line in license block.
index f139d72..2034137 100644 (file)
 #include <sys/time.h>
 #endif
 
+#if defined(__rtems__)
+#include <unistd.h>
+/* 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
index 4a9e6ad..ad88268 100644 (file)
@@ -184,7 +184,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);