This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 3/3] gcc/ada/socket.c: Add conditionals for RTEMS
- From: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- Date: Mon, 11 Aug 2014 10:08:15 -0500
- Subject: [PATCH 3/3] gcc/ada/socket.c: Add conditionals for RTEMS
- Authentication-results: sourceware.org; auth=none
- References: <1407769695-4288-1-git-send-email-joel dot sherrill at oarcorp dot com>
This patch is needed to make Ada compile for *-*-rtems*
on GCC 4.8, 4.9, and the head. Is is ok to commit?
2014-08-11 Joel Sherrill <joel.sherrill@oarcorp.com>
* socket.c: Add conditionals for RTEMS. Add include of <unistd.h>
and so correct prototype of gethostbyname_r() is used.
---
gcc/ada/socket.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c
index 4a9e6ad..631bfdc 100644
--- a/gcc/ada/socket.c
+++ b/gcc/ada/socket.c
@@ -60,6 +60,11 @@ typedef int IOCTL_Req_T;
#include <string.h>
/* Required for memcpy() */
+#if defined(__rtems__)
+#include <unistd.h>
+/* Required, for read(), write(), and close() */
+#endif
+
extern void __gnat_disable_sigpipe (int fd);
extern void __gnat_disable_all_sigpipes (void);
extern int __gnat_create_signalling_fds (int *fds);
@@ -184,7 +189,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);
--
1.9.3