From patchwork Tue Aug 12 14:31:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Sherrill X-Patchwork-Id: 379376 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id AF19C1400B2 for ; Wed, 13 Aug 2014 00:32:08 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=VneGGRs561TeSK+P5+/Bfw1ezR6PCmxfrB6m+mqpXsOsUpgRzYoQA 8px0PpuhT8QkC7YdApTYtZNJmiHiSfT+idiHVGk4Q/X8VRu8SSOgt3LaMAUhTMBD rkn9f3m4H2jRSP37ai/UN14YNmjlSXqRoatZ3e6Ol27nqn+ZYkl2fc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=J3VuC2IorXUr1/yHqgX/elCZt2Q=; b=Me7ZFnhTwnZ2bPCI/4bD VgxHRMcnNVKZbWwvYzTb3mKrBEvwLKTZ82HffnXQLwKtuYzMTuG2DBVrNjbRe5Vn C5Wfuc866KwjSijmmr0hUsUhhB1XY8Kx2lGP0w4WHMgZ8XBzSEUO2kMi5jIt8A2N fWWpYfkgGrVDbD/JLbY8CJ4= Received: (qmail 20910 invoked by alias); 12 Aug 2014 14:31:44 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 20698 invoked by uid 89); 12 Aug 2014 14:31:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: mx.rtems.org Received: from mx.rtems.org (HELO mx.rtems.org) (140.211.10.141) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 12 Aug 2014 14:31:27 +0000 Received: from rtems.org (rtems.org [67.63.146.250]) by mx.rtems.org (Postfix) with ESMTP id 697D0361126; Tue, 12 Aug 2014 14:31:25 +0000 (UTC) Received: from rtbf64a.rtems.org (rtbf64a.rtems.org [192.168.1.92]) by rtems.org (Postfix) with ESMTP id 127454D00E7; Tue, 12 Aug 2014 09:31:25 -0500 (CDT) Received: from rtbf64a.rtems.org (localhost [127.0.0.1]) by rtbf64a.rtems.org (8.14.8/8.14.8) with ESMTP id s7CEVOtw011202; Tue, 12 Aug 2014 09:31:24 -0500 Received: (from joel@localhost) by rtbf64a.rtems.org (8.14.8/8.14.8/Submit) id s7CEVOho011201; Tue, 12 Aug 2014 09:31:24 -0500 From: Joel Sherrill To: gcc-patches@gcc.gnu.org Cc: Joel Sherrill Subject: [PATCH 2/2] gcc/ada/socket.c, gsocket.h: Add conditionals for RTEMS Date: Tue, 12 Aug 2014 09:31:21 -0500 Message-Id: <1407853881-11152-2-git-send-email-joel.sherrill@oarcorp.com> In-Reply-To: <1407853881-11152-1-git-send-email-joel.sherrill@oarcorp.com> References: <1407853881-11152-1-git-send-email-joel.sherrill@oarcorp.com> Hopefully this addresses the comments. OK to comment? 2014-08-12 Joel Sherrill * socket.c: For RTEMS, use correct prototype of gethostbyname_r(). * gsocket.h Add include of on RTEMS. --- gcc/ada/gsocket.h | 5 +++++ gcc/ada/socket.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/ada/gsocket.h b/gcc/ada/gsocket.h index f139d72..2034137 100644 --- a/gcc/ada/gsocket.h +++ b/gcc/ada/gsocket.h @@ -184,6 +184,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 4a9e6ad..ad88268 100644 --- a/gcc/ada/socket.c +++ b/gcc/ada/socket.c @@ -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);