From: Jarkko Hietaniemi Date: Tue, 19 Oct 1999 07:22:34 +0000 (+0000) Subject: Long double support: sqrtl et al are not available everywhere, X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=68d4903c0b61c4d934b03bae806cb56100c9116c;p=p5sagit%2Fp5-mst-13.2.git Long double support: sqrtl et al are not available everywhere, e.g. not in Solaris, even when long doubles are. p4raw-id: //depot/cfgperl@4411 --- diff --git a/Configure b/Configure index 54636fe..1a087c8 100755 --- a/Configure +++ b/Configure @@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Sun Oct 3 02:41:02 EET DST 1999 [metaconfig 3.0 PL70] +# Generated on Tue Oct 19 10:23:39 EET DST 1999 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.com) cat >/tmp/c1$$ <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$d_sfio USE_SFIO /**/ +/* HAS_SQRTL: + * This symbol, if defined, indicates that the sqrtl routine is + * available to do long double square roots. + */ +#$d_sqrtl HAS_SQRTL /**/ + /* HAS_FSTATFS: * This symbol, if defined, indicates that the fstatfs routine is * available to stat filesystems of file descriptors. diff --git a/perl.h b/perl.h index eb88c39..501c635 100644 --- a/perl.h +++ b/perl.h @@ -1077,9 +1077,7 @@ Free_t Perl_mfree (Malloc_t where); #define PTR2NV(p) NUM2PTR(NV,p) #ifdef USE_LONG_DOUBLE -# if defined(HAS_LONG_DOUBLE) && (LONG_DOUBLESIZE > DOUBLESIZE) -# define LDoub_t long double -# else +# if !(defined(HAS_LONG_DOUBLE) && (LONG_DOUBLESIZE > DOUBLESIZE)) # undef USE_LONG_DOUBLE /* Ouch! */ # endif #endif @@ -1123,43 +1121,48 @@ Free_t Perl_mfree (Malloc_t where); default value for printing floating point numbers in Gconvert. (see config.h) */ -#ifdef I_LIMITS -#include -#endif -#ifdef I_FLOAT -#include -#endif -#ifndef HAS_LDBL_DIG -#if LONG_DOUBLESIZE == 10 -#define LDBL_DIG 18 /* assume IEEE */ -#else -#if LONG_DOUBLESIZE == 16 -#define LDBL_DIG 33 /* assume IEEE */ -#else -#if LONG_DOUBLESIZE == DOUBLESIZE -#define LDBL_DIG DBL_DIG /* bummer */ -#endif -#endif -#endif -#endif +# ifdef I_LIMITS +# include +# endif +# ifdef I_FLOAT +# include +# endif +# ifndef HAS_LDBL_DIG +# if LONG_DOUBLESIZE == 10 +# define LDBL_DIG 18 /* assume IEEE */ +# else +# if LONG_DOUBLESIZE == 12 +# define LDBL_DIG 18 /* gcc? */ +# else +# if LONG_DOUBLESIZE == 16 +# define LDBL_DIG 33 /* assume IEEE */ +# else +# if LONG_DOUBLESIZE == DOUBLESIZE +# define LDBL_DIG DBL_DIG /* bummer */ +# endif +# endif +# endif +# endif +# endif #endif #ifdef USE_LONG_DOUBLE -# define HAS_LDOUB - typedef LDoub_t NV; + typedef long double NV; # define NVSIZE LONG_DOUBLESIZE # define NV_DIG LDBL_DIG -# define Perl_modf modfl -# define Perl_frexp frexpl -# define Perl_cos cosl -# define Perl_sin sinl -# define Perl_sqrt sqrtl -# define Perl_exp expl -# define Perl_log logl -# define Perl_atan2 atan2l -# define Perl_pow powl -# define Perl_floor floorl -# define Perl_fmod fmodl +# ifdef HAS_SQRTL +# define Perl_modf modfl +# define Perl_frexp frexpl +# define Perl_cos cosl +# define Perl_sin sinl +# define Perl_sqrt sqrtl +# define Perl_exp expl +# define Perl_log logl +# define Perl_atan2 atan2l +# define Perl_pow powl +# define Perl_floor floorl +# define Perl_fmod fmodl +# endif #else typedef double NV; # define NVSIZE DOUBLESIZE