s/dXS_TARGET/dXSTARG/ in change#4044 (to match dARGS vs dXSARGS
[p5sagit/p5-mst-13.2.git] / perl.h
diff --git a/perl.h b/perl.h
index dae4390..94af360 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -470,10 +470,6 @@ register struct op *Perl_op asm(stringify(OP_IN_REGISTER));
 #  include "embed.h"
 #endif
 
-#if defined(NeXT) || defined(__NeXT) || defined (__MACHTEN__)
-#  undef PERL_POLLUTE_MALLOC
-#endif
-
 #define MEM_SIZE Size_t
 
 #if defined(STANDARD_C) && defined(I_STDDEF)
@@ -1022,7 +1018,11 @@ Free_t   Perl_mfree (Malloc_t where);
 #  if defined(INT32_MAX) && LONGSIZE == 4
 #    define IV_MAX INT32_MAX
 #    define IV_MIN INT32_MIN
-#    define UV_MAX UINT32_MAX
+#    ifndef UINT32_MAX_BROKEN /* e.g. HP-UX with gcc messes this up */
+#        define UV_MAX UINT32_MAX
+#    else
+#        define UV_MAX 4294967295U
+#    endif
 #    ifndef UINT32_MIN
 #      define UINT32_MIN 0
 #    endif
@@ -1044,8 +1044,20 @@ Free_t   Perl_mfree (Malloc_t where);
 #  define IVSIZE LONGSIZE
 #endif
 #define IV_DIG (BIT_DIGITS(IVSIZE * 8))
-#define UV_DIG (BIT_DIGITS(IVSIZE * 8))
+#define UV_DIG (BIT_DIGITS(UVSIZE * 8))
 
+#if (IVSIZE > PTRSIZE) || (UVSIZE > PTRSIZE)
+#  if PTRSIZE == LONGSIZE 
+#    define PTRV       unsigned long
+#  else
+#    define PTRV       unsigned
+#  endif
+#  define PTR_CAST     (PTRV)
+#else
+#  define PTRV         UV
+#  define PTR_CAST 
+#endif
+  
 #ifdef USE_LONG_DOUBLE
 #  if defined(HAS_LONG_DOUBLE) && (LONG_DOUBLESIZE > DOUBLESIZE)
 #    define LDoub_t long double
@@ -1702,6 +1714,22 @@ typedef pthread_key_t    perl_key;
 #  endif
 #endif
 
+#if defined(PERL_IMPLICIT_CONTEXT) && !defined(PERL_GET_THX)
+#  ifdef USE_THREADS
+#    define PERL_GET_THX               THR
+#  else
+#  ifdef MULTIPLICITY
+#    define PERL_GET_THX               PERL_GET_INTERP
+#  else
+#  ifdef PERL_OBJECT
+#    define PERL_GET_THX               ((CPerlObj*)PERL_GET_INTERP)
+#  else
+#    define PERL_GET_THX               ((void*)0)
+#  endif
+#  endif
+#  endif
+#endif
+
 /* Some unistd.h's give a prototype for pause() even though
    HAS_PAUSE ends up undefined.  This causes the #define
    below to be rejected by the compmiler.  Sigh.
@@ -2012,8 +2040,10 @@ struct ufuncs {
 /* Fix these up for __STDC__ */
 #ifndef DONT_DECLARE_STD
 char *mktemp (char*);
+#ifndef atof
 double atof (const char*);
 #endif
+#endif
 
 #ifndef STANDARD_C
 /* All of these are in stdlib.h or time.h for ANSI C */