long double (was "strtold?")

Jeff Johnston jjohnstn@redhat.com
Mon Apr 20 20:04:00 GMT 2009


Ken Werner wrote:
> On Saturday 18 April 2009 00:14:13 you wrote:
>   
>> Ken Werner wrote:
>>     
>>> On Friday 17 April 2009 23:19:33 Howland Craig D (Craig) wrote:
>>>       
>>>> Umm, I don't understand the change to machine/ieeefp.h.  The defines
>>>> that it was using are the official names from float.h.  Adding __ as a
>>>> prefix and suffix ties it directly to gcc.  The makes it work for gcc
>>>> without float.h having been included, but won't it break other
>>>> compilers?
>>>> (There's nothing in the standards that I know of that would require
>>>> __LDBL_MANT_DIG__ to be defined, for example.)  So perhaps it did not
>>>> build as it was, but the way to fix it for all compilers is to add
>>>> #include <float.h>, I think.  (Newlib doesn't require gcc, does it?)
>>>> 				Craig
>>>>         
>>> Craig,
>>>
>>> Thanks for the heads up, you are right. The attached patch uses defines
>>> provided by <float.h> instead of the GCC internals.
>>>
>>> Ken
>>>       
>> Actually, I don't want float.h as an implied include in this case since
>> we are defining an internal-use
>> variable as opposed to something we need to expose to the end-user (in
>> which case we would check for
>> gcc and avoid the include if possible).
>>
>> So, I have undergone moving the macro to libc/stdlib/local.h and adding
>> libm/common/local.h where it can
>> safely include float.h without affecting the end-user.  All the files
>> needing _LDBL_EQ_DBL now include the "local.h" file in its directory.
>> The patch will be checked in shortly.
>>
>> -- Jeff J.
>>     
>
> Hi,
>
> Sounds fine for the implementation of the wrapper frunctions but what about 
> their prototypes? Are you going to include "local.h" from the  math.h and 
> stdlib.h?
>
> Ken
>   
My bad...I should have renamed the flag in the headers.  It will now be 
_HAVE_LDBL_MATH for math.h and _HAVE_LDBL_STDLIB  for stdlib.h which for 
now have to be manually set per platform (typically via 
libc/include/sys/config.h).  I am open to putting your gcc-specific 
check into libc/include/sys/config.h which would then set the two flags 
automatically, if not already set.

-- Jeff J.




More information about the Newlib mailing list