Integrate with Sarathy.
[p5sagit/p5-mst-13.2.git] / perl.h
diff --git a/perl.h b/perl.h
index ad5af2f..d9dcbba 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -985,7 +985,7 @@ struct perl_mstats {
 typedef IVTYPE IV;
 typedef UVTYPE UV;
 
-#if defined(USE_64_BITS) && defined(HAS_QUAD)
+#if defined(USE_64_BIT_INT) && defined(HAS_QUAD)
 #  if QUADKIND == QUAD_IS_INT64_T && defined(INT64_MAX)
 #    define IV_MAX INT64_MAX
 #    define IV_MIN INT64_MIN
@@ -1135,7 +1135,14 @@ typedef UVTYPE UV;
 
 typedef NVTYPE NV;
 
+#ifdef I_IEEEFP
+#   include <ieeefp.h>
+#endif
+
 #ifdef USE_LONG_DOUBLE
+#   ifdef I_SUNMATH
+#       include <sunmath.h>
+#   endif
 #   define NV_DIG LDBL_DIG
 #   ifdef HAS_SQRTL
 #       define Perl_modf modfl
@@ -1418,12 +1425,7 @@ typedef struct ptr_tbl PTR_TBL_t;
 
 #include "handy.h"
 
-#ifndef NO_LARGE_FILES
-#   define USE_LARGE_FILES     /* If available. */
-#endif
-
 #if defined(USE_LARGE_FILES) && !defined(NO_64_BIT_RAWIO)
-#   define USE_64_BIT_RAWIO    /* explicit */
 #   if LSEEKSIZE == 8 && !defined(USE_64_BIT_RAWIO)
 #       define USE_64_BIT_RAWIO        /* implicit */
 #   endif
@@ -1441,7 +1443,6 @@ typedef struct ptr_tbl PTR_TBL_t;
 #endif
 
 #if defined(USE_LARGE_FILES) && !defined(NO_64_BIT_STDIO)
-#   define USE_64_BIT_STDIO    /* explicit */
 #   if FSEEKSIZE == 8 && !defined(USE_64_BIT_STDIO)
 #       define USE_64_BIT_STDIO /* implicit */
 #   endif
@@ -1722,10 +1723,7 @@ typedef pthread_key_t    perl_key;
 #  define PERL_WAIT_FOR_CHILDREN       NOOP
 #endif
 
-/* the traditional thread-unsafe notion of "current interpreter".
- * XXX todo: a thread-safe version that fetches it from TLS (akin to THR)
- * needs to be defined elsewhere (conditional on pthread_getspecific()
- * availability). */
+/* the traditional thread-unsafe notion of "current interpreter". */
 #ifndef PERL_SET_INTERP
 #  define PERL_SET_INTERP(i)           (PL_curinterp = (PerlInterpreter*)(i))
 #endif
@@ -1736,18 +1734,17 @@ typedef pthread_key_t   perl_key;
 
 #if defined(PERL_IMPLICIT_CONTEXT) && !defined(PERL_GET_THX)
 #  ifdef USE_THREADS
-#    define PERL_GET_THX               THR
+#    define PERL_GET_THX               ((struct perl_thread *)PERL_GET_CONTEXT)
 #  else
 #  ifdef MULTIPLICITY
-#    define PERL_GET_THX               PERL_GET_INTERP
+#    define PERL_GET_THX               ((PerlInterpreter *)PERL_GET_CONTEXT)
 #  else
 #  ifdef PERL_OBJECT
-#    define PERL_GET_THX               ((CPerlObj*)PERL_GET_INTERP)
-#  else
-#    define PERL_GET_THX               ((void*)0)
+#    define PERL_GET_THX               ((CPerlObj *)PERL_GET_CONTEXT)
 #  endif
 #  endif
 #  endif
+#  define PERL_SET_THX(t)              PERL_SET_CONTEXT(t)
 #endif
 
 #ifndef SVf
@@ -2108,7 +2105,7 @@ char *crypt (const char*, const char*);
 #    ifndef getenv
 char *getenv (const char*);
 #    endif /* !getenv */
-#    if !defined(EPOC) && !(defined(__hpux) && defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+#    if !defined(EPOC) && !(defined(__hpux) && defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64) && !defined(HAS_LSEEK_PROTO)
 Off_t lseek (int,Off_t,int);
 #    endif
 #  endif /* !DONT_DECLARE_STD */
@@ -3079,6 +3076,9 @@ typedef struct am_table_short AMTS;
 #endif /* !USE_LOCALE_NUMERIC */
 
 #if !defined(Atol) && defined(IV_IS_QUAD) && QUADKIND == QUAD_IS_LONG_LONG
+#    ifdef __hpux
+#        define strtoll __strtoll      /* secret handshake */
+#    endif
 #   if !defined(Atol) && defined(HAS_STRTOLL)
 #       define Atol(s) strtoll(s, (char**)NULL, 10)
 #   endif
@@ -3092,6 +3092,9 @@ typedef struct am_table_short AMTS;
 #endif
 
 #if !defined(Strtoul) && defined(UV_IS_QUAD) && QUADKIND == QUAD_IS_LONG_LONG
+#    ifdef __hpux
+#        define strtoull __strtoull    /* secret handshake */
+#    endif
 #    if !defined(Strtoul) && defined(HAS_STRTOULL)
 #       define Strtoul strtoull
 #    endif
@@ -3113,6 +3116,23 @@ typedef struct am_table_short AMTS;
 #define printf PerlIO_stdoutf
 #endif
 
+/* if these never got defined, they need defaults */
+#ifndef PERL_SET_CONTEXT
+#  define PERL_SET_CONTEXT(i)          PERL_SET_INTERP(i)
+#endif
+
+#ifndef PERL_GET_CONTEXT
+#  define PERL_GET_CONTEXT             PERL_GET_INTERP
+#endif
+
+#ifndef PERL_GET_THX
+#  define PERL_GET_THX                 ((void*)NULL)
+#endif
+
+#ifndef PERL_SET_THX
+#  define PERL_SET_THX(t)              NOOP
+#endif
+
 #ifndef PERL_SCRIPT_MODE
 #define PERL_SCRIPT_MODE "r"
 #endif
@@ -3268,7 +3288,7 @@ typedef struct am_table_short AMTS;
    HAS_MMAP
    HAS_MPROTECT
    HAS_MSYNC
-   HAS_MADVSISE
+   HAS_MADVISE
    HAS_MUNMAP
    I_SYSMMAN
    Mmap_t