This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
RE: long double (was "strtold?")
> -----Original Message-----
> From: newlib-owner@sourceware.org
> [mailto:newlib-owner@sourceware.org] On Behalf Of Ken Werner
> Sent: Wednesday, March 11, 2009 7:05 PM
> To: newlib@sourceware.org; Howland Craig D (Craig)
> Subject: Re: long double (was "strtold?")
>
> Hi,
> What about mapping the long double functions to their
> counterparts on platforms where a double is as wide as a long
> double? The attached patch introduces a flag defined in
> sys/features.h. You mentioned HAVE_LONG_DOUBLE_WIDER but the
> user may not define this flag. Do you want to generate a
> header file that exposes this flag? Wouldn't that result in
> something like config.h to be shipped with newlib or am I
> missing something?
Hi,
may I suggest deriving the flag (_DOUBLE_EQUALS_LONG_DOUBLE) from macros
defined by <float.h>? E.g., replace
# ifdef _DOUBLE_EQUALS_LONG_DOUBLE
with
# if _DOUBLE_EQUALS_LONG_DOUBLE
Define _DOUBLE_EQUALS_LONG_DOUBLE as
# define _DOUBLE_EQUALS_LONG_DOUBLE (DBL_MANT_DIG == LDBL_MANT_DIG\
&& LDBL_MIN_EXP == DBL_MIN_EXP\
&& LDBL_MAX_EXP == DBL_MAX_EXP)
This would simplify porting to new targets.
Konrad Schwarz