From patchwork Fri May 8 14:38:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Brobecker X-Patchwork-Id: 6630 Received: (qmail 27303 invoked by alias); 8 May 2015 14:38:22 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 25981 invoked by uid 89); 8 May 2015 14:38:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 08 May 2015 14:38:20 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 730B8287D0; Fri, 8 May 2015 10:38:18 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id YdFnP6H8XlBD; Fri, 8 May 2015 10:38:18 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 464D7D3ACE; Fri, 8 May 2015 10:38:18 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id D04A240DAA; Fri, 8 May 2015 07:38:17 -0700 (PDT) From: Joel Brobecker To: gcc-patches@gcc.gnu.org Cc: gdb-patches@sourceware.org Subject: [RFA] libiberty/mkstemps.c: Include if not available. Date: Fri, 8 May 2015 07:38:11 -0700 Message-Id: <1431095891-7196-1-git-send-email-brobecker@adacore.com> Hello, Attempting to build libiberty on LynxOS-178 fails trying to compile mkstemps.c with the following error: mkstemps.c:84:18: error: storage size of 'tv' isn't known struct timeval tv; ^ This file would normally include to get the type's definition, but unfortunately LynxOS-178 does not want us to use , only . The configure script correctly finds this out and generates a config.h file where HAVE_SYS_TIME_H is undefined: /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_TIME_H */ This patch fixes the build issue by falling back on including if could not be included (and provided that HAVE_TIME_H is defined, of course). libiberty/ChangeLog: * mkstemps.c: #include if HAVE_TIME_H is defined but not HAVE_SYS_TIME_H. OK to commit? Thank you, diff --git a/libiberty/mkstemps.c b/libiberty/mkstemps.c index a0e68a7..0e06fe1 100644 --- a/libiberty/mkstemps.c +++ b/libiberty/mkstemps.c @@ -35,6 +35,8 @@ #endif #ifdef HAVE_SYS_TIME_H #include +#elif HAVE_TIME_H +#include #endif #include "ansidecl.h"