summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-10-29 15:24:13 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-10-29 15:24:13 +0000
commitd7d93a8159c0ca10065c583e76157a51736a62cd (patch)
treef3a39f4d05385b4024b9735f2f8326d9b408756b /perl.h
parentf868067f71962292cefa95e71c0bed29258aec96 (diff)
downloadperl-d7d93a8159c0ca10065c583e76157a51736a62cd.tar.gz
Remove quad logic from perl.h; regen Configure;
add -DUSE_LONG_LONG to ccflags if not already there. p4raw-id: //depot/cfgperl@4487
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h109
1 files changed, 8 insertions, 101 deletions
diff --git a/perl.h b/perl.h
index 94bfddbd55..d25345e9a8 100644
--- a/perl.h
+++ b/perl.h
@@ -901,104 +901,10 @@ Free_t Perl_mfree (Malloc_t where);
--Andy Dougherty August 1996
*/
-/* We should be able to get Quad_t in most systems:
- all of int64_t, long long, long, int, will work.
-
- Beware of LP32 systems (ILP32, ILP32LL64). Such systems have been
- used to sizeof(long) == sizeof(foo*). This is a bad assumption
- because then IV/UV have been 32 bits, too. Which, in turn means
- that even if the system has quads (e.g. long long), IV cannot be a
- quad. Introducing a 64-bit IV (because of long long existing)
- will introduce binary incompatibility.
-
- Summary: a long long system needs to add -DUSE_LONG_LONG to $ccflags
- to get quads -- and if its pointers are still 32 bits, this will break
- binary compatibility. Casting an IV (a long long) to a pointer will
- truncate half of the IV away. Most systems can just use
- Configure -Duse64bits to get the -DUSE_LONG_LONG added either by
- their hints files, or directly by Configure if they are using gcc.
-
- --jhi September 1999 */
-
-#if INTSIZE == 4 && LONGSIZE == 4 && PTRSIZE == 4
-# define PERL_ILP32
-# if defined(HAS_LONG_LONG) && LONGLONGSIZE == 8
-# define PERL_ILP32LL64
-# endif
-#endif
-
-#if LONGSIZE == 8 && PTRSIZE == 8
-# define PERL_LP64
-# if INTSIZE == 8
-# define PERL_ILP64
-# endif
-#endif
-
-#ifndef Quad_t
-# if LONGSIZE == 8
-# define Quad_t long
-# define Uquad_t unsigned long
-# define PERL_QUAD_IS_LONG
-# endif
-#endif
-
-#ifndef Quad_t
-# if INTSIZE == 8
-# define Quad_t int
-# define Uquad_t unsigned int
-# define PERL_QUAD_IS_INT
-# endif
-#endif
-
-#ifndef Quad_t
-# ifdef USE_LONG_LONG /* See above note about LP32. --jhi */
-# if defined(HAS_LONG_LONG) && LONGLONGSIZE == 8
-# define Quad_t long long
-# define Uquad_t unsigned long long
-# define PERL_QUAD_IS_LONG_LONG
-# endif
-# endif
-#endif
-
-#ifndef Quad_t
-# ifdef HAS_INT64_T
-# define Quad_t int64_t
-# define Uquad_t uint64_t
-# define PERL_QUAD_IS_INT64_T
-# endif
-#endif
-
-#ifdef Quad_t
-# define HAS_QUAD
-# ifndef Uquad_t
- /* Note that if your Quad_t is a typedef (not a #define) you *MUST*
- * have defined by now Uquad_t yourself because 'unsigned type'
- * is illegal. */
-# define Uquad_t unsigned Quad_t
-# endif
-#endif
-
-#if defined(USE_64_BITS) && defined(HAS_QUAD)
-# ifdef PERL_QUAD_IS_LONG /* LP64 */
- typedef long IV;
- typedef unsigned long UV;
-# else
-# ifdef PERL_QUAD_IS_INT /* ILP64 */
- typedef int IV;
- typedef unsigned int UV;
-# else
-# ifdef PERL_QUAD_IS_LONG_LONG /* LL64 */
- typedef long long IV;
- typedef unsigned long long UV;
-# else
-# ifdef PERL_QUAD_IS_INT64_T /* C9X */
- typedef int64_t IV;
- typedef uint64_t UV;
-# endif
-# endif
-# endif
-# endif
-# if defined(PERL_QUAD_IS_INT64_T) && defined(INT64_MAX)
+#if defined(USE_64_BITS) && defined(Quad_t)
+ typedef Quad_t IV;
+ typedef Uquad_t UV;
+# if QUADCASE == 4 && defined(INT64_MAX) /* quad is int64_t */
# define IV_MAX INT64_MAX
# define IV_MIN INT64_MIN
# define UV_MAX UINT64_MAX
@@ -1017,8 +923,8 @@ Free_t Perl_mfree (Malloc_t where);
# define IV_IS_QUAD
# define UV_IS_QUAD
#else
- typedef long IV;
- typedef unsigned long UV;
+ typedef long IV;
+ typedef unsigned long UV;
# if defined(INT32_MAX) && LONGSIZE == 4
# define IV_MAX INT32_MAX
# define IV_MIN INT32_MIN
@@ -1047,6 +953,7 @@ Free_t Perl_mfree (Malloc_t where);
# define UVSIZE LONGSIZE
# define IVSIZE LONGSIZE
#endif
+
#define IV_DIG (BIT_DIGITS(IVSIZE * 8))
#define UV_DIG (BIT_DIGITS(UVSIZE * 8))
@@ -1355,7 +1262,7 @@ Free_t Perl_mfree (Malloc_t where);
# endif
#endif
-#ifdef HAS_QUAD
+#ifdef UV_IS_QUAD
# ifdef UQUAD_MAX
# define PERL_UQUAD_MAX ((UV)UQUAD_MAX)