integrate cfgperl contents (op.[ch] needed manual resolve)
[p5sagit/p5-mst-13.2.git] / perl.h
diff --git a/perl.h b/perl.h
index a4737af..f00566f 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -470,7 +470,7 @@ register struct op *Perl_op asm(stringify(OP_IN_REGISTER));
 #   include <stdlib.h>
 #endif
 
-#if !defined(PERL_FOR_X2P) && !defined(PERL_OBJECT)
+#if !defined(PERL_FOR_X2P) && !defined(WIN32)
 #  include "embed.h"
 #endif
 
@@ -891,10 +891,6 @@ Free_t   Perl_mfree (Malloc_t where);
 #undef UV
 #endif
 
-#ifdef I_INTTYPES
-#include <inttypes.h>
-#endif
-
 /*
     The IV type is supposed to be long enough to hold any integral
     value or a pointer.
@@ -905,7 +901,7 @@ typedef IVTYPE IV;
 typedef UVTYPE UV;
 
 #if defined(USE_64_BITS) && defined(HAS_QUAD)
-#  if QUADCASE == 4 && defined(INT64_MAX) /* quad is int64_t */
+#  if QUADKIND == QUAD_IS_INT64_T && defined(INT64_MAX)
 #    define IV_MAX INT64_MAX
 #    define IV_MIN INT64_MIN
 #    define UV_MAX UINT64_MAX
@@ -1326,19 +1322,39 @@ typedef struct xpvfm XPVFM;
 typedef struct xpvio XPVIO;
 typedef struct mgvtbl MGVTBL;
 typedef union any ANY;
+typedef struct svtblent SVTBLENT;
+typedef struct svtbl SVTBL;
 
 #include "handy.h"
 
-#if defined(USE_LARGE_FILES)
-#   define USE_64_BIT_RAWIO /* Explicit */
-#   define USE_64_BIT_STDIO
+#ifndef NO_LARGE_FILES
+#   define USE_LARGE_FILES     /* If available. */
 #endif
 
-#if LSEEKSIZE == 8 && !defined(USE_64_BIT_RAWIO)
-#   define USE_64_BIT_RAWIO /* Implicit */
+#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
 #endif
 
-/* Do we need FSEEKSIZE? */
+/* Notice the use of HAS_FSEEKO: now we are obligated to always use
+ * fseeko/ftello if possible.  Don't go #defining ftell to ftello yourself,
+ * however, because operating systems like to do that themself. */
+#ifndef FSEEKSIZE
+#   ifdef HAS_FSEEKO
+#       define FSEEKSIZE LSEEKSIZE
+#   else
+#       define FSEEKSIZE LONGSIZE
+#   endif  
+#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
+#endif
 
 /* I couldn't find any -Ddefine or -flags in IRIX 6.5 that would
  * have done the necessary symbol renaming using cpp. --jhi */
@@ -1367,9 +1383,10 @@ typedef union any ANY;
 #   endif
 #   if defined(USE_LSEEK64)
 #       define lseek lseek64
-#   endif
-#   if defined(USE_LLSEEK)
-#       define lseek llseek
+#   else
+#       if defined(USE_LLSEEK)
+#           define lseek llseek
+#       endif
 #   endif
 #   if defined(USE_STAT64)
 #       define stat stat64
@@ -1409,10 +1426,10 @@ typedef union any ANY;
 #       define fopen fopen64
 #   endif
 #   if defined(USE_FSEEK64)
-#       define fseek fseek64
+#       define fseek fseek64 /* don't do fseeko here, see perlio.c */
 #   endif
 #   if defined(USE_FTELL64)
-#       define ftell ftell64
+#       define ftell ftell64 /* don't do ftello here, see perlio.c */
 #   endif
 #   if defined(USE_FSETPOS64)
 #       define fsetpos fsetpos64
@@ -1749,6 +1766,18 @@ struct scan_data_t;              /* Used in S_* functions in regcomp.c */
 
 typedef I32 CHECKPOINT;
 
+struct svtblent {
+    struct svtblent*   next;
+    SV*                        oldval;
+    SV*                        newval;
+};
+
+struct svtbl {
+    struct svtblent**  tbl_ary;
+    UV                 tbl_max;
+    UV                 tbl_items;
+};
+
 #if defined(iAPX286) || defined(M_I286) || defined(I80286)
 #   define I286
 #endif
@@ -1861,10 +1890,6 @@ typedef I32 CHECKPOINT;
 #   define MAXSYSFD 2
 #endif
 
-#ifndef TMPPATH
-#  define TMPPATH "/tmp/perl-eXXXXXX"
-#endif
-
 #ifndef __cplusplus
 Uid_t getuid (void);
 Uid_t geteuid (void);
@@ -2581,13 +2606,6 @@ typedef void *Thread;
 #  define PERL_CALLCONV
 #endif 
 
-#ifdef PERL_OBJECT
-#  define VIRTUAL virtual PERL_CALLCONV
-#else
-#  define VIRTUAL PERL_CALLCONV
-/*START_EXTERN_C*/
-#endif
-
 #ifndef NEXT30_NO_ATTRIBUTE
 #  ifndef HASATTRIBUTE       /* disable GNU-cc attribute checking? */
 #    ifdef  __attribute__      /* Avoid possible redefinition errors */
@@ -2615,10 +2633,8 @@ public:
 #include "pp_proto.h"
 
 #ifdef PERL_OBJECT
-VIRTUAL int CPerlObj::do_aspawn (void *vreally, void **vmark, void **vsp);
+int CPerlObj::do_aspawn (void *vreally, void **vmark, void **vsp);
 #undef PERL_DECL_PROT
-#else
-/*END_EXTERN_C*/
 #endif
 
 #ifndef PERL_OBJECT
@@ -2675,6 +2691,10 @@ PERLVARA(object_compatibility,30,        char)
 /* this has structure inits, so it cannot be included before here */
 #  include "opcode.h"
 
+#else
+#  if defined(WIN32)
+#    include "embed.h"
+#  endif
 #endif  /* PERL_OBJECT */
 
 #ifndef PERL_GLOBAL_STRUCT
@@ -3033,6 +3053,34 @@ typedef struct am_table_short AMTS;
 #endif
 
 /*
+ * Some operating systems are stingy with stack allocation,
+ * so perl may have to guard against stack overflow.
+ */
+#ifndef PERL_STACK_OVERFLOW_CHECK
+#define PERL_STACK_OVERFLOW_CHECK()  NOOP
+#endif
+
+/*
+ * Some nonpreemptive operating systems find it convenient to
+ * check for asynchronous conditions after each op execution.
+ * Keep this check simple, or it may slow down execution
+ * massively.
+ */
+#ifndef PERL_ASYNC_CHECK
+#define PERL_ASYNC_CHECK()  NOOP
+#endif
+
+/*
+ * On some operating systems, a memory allocation may succeed,
+ * but put the process too close to the system's comfort limit.
+ * In this case, PERL_ALLOC_CHECK frees the pointer and sets
+ * it to NULL.
+ */
+#ifndef PERL_ALLOC_CHECK
+#define PERL_ALLOC_CHECK(p)  NOOP
+#endif
+
+/*
  * nice_chunk and nice_chunk size need to be set
  * and queried under the protection of sv_mutex
  */