From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75648 invoked by alias); 21 Jun 2017 15:02:12 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 75594 invoked by uid 89); 21 Jun 2017 15:02:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=craig, ages, Newlib, H*f:sk:0205aa5 X-HELO: mail02.lgsinnovations.com Received: from mail02.lgsinnovations.com (HELO mail02.lgsinnovations.com) (63.149.110.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 21 Jun 2017 15:02:08 +0000 Subject: Re: Importing cacoshl.c and its dependent methos, To: References: <0205aa55-7b80-245d-0af6-4fe67c15429f@embedded-brains.de> <20170621082825.GD6658@calimero.vinschen.de> From: Craig Howland Message-ID: Date: Wed, 21 Jun 2017 15:02:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LGS-EX05.lgsdirect.com (135.22.48.227) To LGS-EX01.lgsdirect.com (135.22.77.164) X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00447.txt.bz2 On 06/21/2017 08:04 AM, aditya upadhyay wrote: > So ,To not rely on stdbool.h from c99, do i have to port stdbool.h here also ? > Otherwise we can use > #ifndef __cplusplus > typedef enum { false, true } bool; > #endif > > Thanks a lot for your suggested modification. I am applying the > required the modification. > > Regards, > Aditya Upadhyay > > On Wed, Jun 21, 2017 at 1:58 PM, Corinna Vinschen wrote: >> On Jun 21 08:46, Sebastian Huber wrote: >>> On 21/06/17 04:24, aditya upadhyay wrote: >>> >>>> Hello Developers, >>>> In cacoshl.c, There is a dependency between cacoshl.c and csqrtl.c. >>>> In ported csqrtl.c from NetBSD, stdbool.h is there, But i saw there >>>> is no stdbool.h. >>>> >>>> So for bool data type, I have used enum. Is it a right way or not. >>>> please suggest or do i have to use stdbool.h from gcc library ? >>> is currently not used by Newlib. I am not sure if we should add >>> this dependency if its only needed by csqrtl.c (in overall NetBSD libm) and >>> not visible to the user. >>> >>> I would replace the #include with >>> >>> #ifndef __cplusplus >>> typedef enum { false, true } bool; >>> #endif >>> >>> and keep the rest of the code unchanged. >> Wait. Isn't stdbool.h available in gcc for ages? When building newlib, >> shouldn't we be able to rely on c99 being available? >> >> >> Corinna >> Yes, we can, and should. That's because complex.h and stdbool.h were added in C99, making C99 required for these functions. I did a quick check on some older cross-compiler installs that I have, and GCC 4.1.1 has stdbool.h (and 4.6.4 has complex.h). Craig