diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 1999-08-01 22:22:51 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 1999-08-01 22:22:51 +0000 |
commit | cf2093f6405d08be483e037b6052608c46952a75 (patch) | |
tree | a2572a825ae30eabcd1fee0cac65751bef6a4d05 /perl.h | |
parent | ad7e816fc202b9506cd8e0633196331ccf37f264 (diff) | |
download | perl-cf2093f6405d08be483e037b6052608c46952a75.tar.gz |
64-bit work. Now 32-bit platforms get a 100% make test
with -Duse64bits (using long long).
Tested in Solaris 2.6 sparc RH Linux 6.0 x86
(and Digital IX 4.0D, to get a true 64-bit opinion). Now e.g.
'print unpack "q", pack "q", 12345678901'
should work on such 32-bit platforms.
Still a lot of printf()s behind -D which wrongly assume
that %ld/%lx and (long) are a good combination.
Introducing a slew of new macros intended to be used in printf()
format strings: e. g. PERL_PRId64 is the string to be used
when printing an IV, printf("%" PERL_PRId64 "\n", iv).
The PRI... naming follows the C9X naming of <inttypes.h> macros.
p4raw-id: //depot/cfgperl@3861
Diffstat (limited to 'perl.h')
-rw-r--r-- | perl.h | 29 |
1 files changed, 27 insertions, 2 deletions
@@ -1024,6 +1024,8 @@ Free_t Perl_mfree (Malloc_t where); # endif # define IV_SIZEOF 8 # define UV_SIZEOF 8 +# define IV_IS_QUAD +# define UV_IS_QUAD #else typedef long IV; typedef unsigned long UV; @@ -1040,6 +1042,13 @@ Free_t Perl_mfree (Malloc_t where); # endif # define UV_SIZEOF LONGSIZE # define IV_SIZEOF LONGSIZE +# if LONGSIZE == 8 +# define IV_IS_QUAD +# define UV_IS_QUAD +# else +# undef IV_IS_QUAD +# undef UV_IS_QUAD +# endif #endif #ifdef USE_LONG_DOUBLE @@ -1061,7 +1070,6 @@ Free_t Perl_mfree (Malloc_t where); # define Perl_atan2 atan2l # define Perl_pow powl # define Perl_floor floorl -# define Perl_atof atof # define Perl_fmod fmodl #else typedef double NV; @@ -1075,10 +1083,15 @@ Free_t Perl_mfree (Malloc_t where); # define Perl_atan2 atan2 # define Perl_pow pow # define Perl_floor floor -# define Perl_atof atof /* At some point there may be an atolf */ # define Perl_fmod fmod #endif +#if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_ATOLF) +# define Perl_atof atolf +#else +# define Perl_atof atof +#endif + /* Previously these definitions used hardcoded figures. * It is hoped these formula are more portable, although * no data one way or another is presently known to me. @@ -2978,6 +2991,18 @@ typedef struct am_table_short AMTS; #endif /* !USE_LOCALE_NUMERIC */ +#if defined(USE_LONG_LONG) && defined(HAS_LONG_LONG) && defined(HAS_ATOLL) +#define Atol atoll +#else +#define Atol atol +#endif + +#if defined(USE_LONG_LONG) && defined(HAS_LONG_LONG) && defined(HAS_STRTOULL) +#define Strtoul strtoull +#else +#define Strtoul strtoul +#endif + #if !defined(PERLIO_IS_STDIO) && defined(HASATTRIBUTE) /* * Now we have __attribute__ out of the way |