# include <stdlib.h>
#endif
-#if !defined(PERL_FOR_X2P) && !defined(PERL_OBJECT)
+#if !defined(PERL_FOR_X2P) && !defined(WIN32)
# include "embed.h"
#endif
#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.
--Andy Dougherty August 1996
*/
-#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 */
+typedef IVTYPE IV;
+typedef UVTYPE UV;
+
+#if defined(USE_64_BITS) && defined(HAS_QUAD)
+# if QUADKIND == QUAD_IS_INT64_T && defined(INT64_MAX)
# define IV_MAX INT64_MAX
# define IV_MIN INT64_MIN
# define UV_MAX UINT64_MAX
# define UV_MAX PERL_UQUAD_MAX
# define UV_MIN PERL_UQUAD_MIN
# endif
-# define IVSIZE 8
-# define UVSIZE 8
# define IV_IS_QUAD
# define UV_IS_QUAD
#else
- typedef long IV;
- typedef unsigned long UV;
-# if defined(INT32_MAX) && LONGSIZE == 4
+# if defined(INT32_MAX) && IVSIZE == 4
# define IV_MAX INT32_MAX
# define IV_MIN INT32_MIN
# ifndef UINT32_MAX_BROKEN /* e.g. HP-UX with gcc messes this up */
# define UV_MAX PERL_ULONG_MAX
# define UV_MIN PERL_ULONG_MIN
# endif
-# if LONGSIZE == 8
+# if IVSIZE == 8
# define IV_IS_QUAD
# define UV_IS_QUAD
+# ifndef HAS_QUAD
+# define HAS_QUAD
+# endif
# else
# undef IV_IS_QUAD
# undef UV_IS_QUAD
+# undef HAS_QUAD
# endif
-# define UVSIZE LONGSIZE
-# define IVSIZE LONGSIZE
#endif
#define IV_DIG (BIT_DIGITS(IVSIZE * 8))
# endif
#endif
+typedef NVTYPE NV;
+
#ifdef USE_LONG_DOUBLE
- typedef long double NV;
-# define NVSIZE LONG_DOUBLESIZE
# define NV_DIG LDBL_DIG
# ifdef HAS_SQRTL
# define Perl_modf modfl
# define Perl_fmod fmodl
# endif
#else
- typedef double NV;
-# define NVSIZE DOUBLESIZE
# define NV_DIG DBL_DIG
# define Perl_modf modf
# define Perl_frexp frexp
typedef struct pvop PVOP;
typedef struct loop LOOP;
-typedef struct Outrec Outrec;
typedef struct interpreter PerlInterpreter;
typedef struct sv SV;
typedef struct av AV;
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 */
# 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
# 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
# if defined(EPOC)
# include "epocish.h"
# else
-# include "unixish.h"
+# if defined(MACOS_TRADITIONAL)
+# include "macos/macish.h"
+# else
+# include "unixish.h"
+# endif
# endif
# endif
# endif
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
#define NV_WITHIN_IV(nv) (I_V(nv) >= IV_MIN && I_V(nv) <= IV_MAX)
#define NV_WITHIN_UV(nv) ((nv)>=0.0 && U_V(nv) >= UV_MIN && U_V(nv) <= UV_MAX)
+/* The correct way: a Configure test where (UV)~0 is cast to NV and back. */
/* Believe. */
#define IV_FITS_IN_NV
/* Doubt. */
# endif
#endif
-#ifdef IV_IS_QUAD
-# define UVuf PERL_PRIu64
-# define IVdf PERL_PRId64
-# define UVof PERL_PRIo64
-# define UVxf PERL_PRIx64
-#else
-# if IVSIZE == LONGSIZE
-# define UVuf "lu"
-# define IVdf "ld"
-# define UVof "lo"
-# define UVxf "lx"
-# else
-# if IVSIZE == INTSIZE
-# define UVuf "u"
-# define IVdf "d"
-# define UVof "o"
-# define UVxf "x"
-# else
-# if IVSIZE == SHORTSIZE /* weird */
-# define UVuf "hu"
-# define IVdf "hd"
-# define UVof "ho"
-# define UVxf "hx"
-# else
- /* well, any good ideas? */
-# endif
-# endif
-# endif
-#endif
-
-/* The Uid_t_f and Gid_t_f definitely look like a job for metaconfig,
- * as do the UVuf, IVdf, UVof, and UVxf above. */
-
-#if Uid_t_SIGN == -1
-# if Uid_t_SIZE == IVSIZE
-# define Uid_t_f IVdf
-# else
-# if Uid_t_SIZE == LONGSIZE
-# define Uid_t_f "ld"
-# else
-# if Uid_t_SIZE == INTSIZE
-# define Uid_t_f "d"
-# else
-# if Uid_t_SIZE == SHORTSIZE
-# define Uid_t_f "hd"
-# else
- /* You tell me. */
-# endif
-# endif
-# endif
-# endif
-#else
-# if Uid_t_SIZE == UVSIZE
-# define Uid_t_f UVuf
-# else
-# if Uid_t_SIZE == LONGSIZE
-# define Uid_t_f "lu"
-# else
-# if Uid_t_SIZE == INTSIZE
-# define Uid_t_f "u"
-# else
-# if Uid_t_SIZE == SHORTSIZE
-# define Uid_t_f "hu"
-# else
- /* You tell me. */
-# endif
-# endif
-# endif
-# endif
-#endif
-
-#if Gid_t_SIGN == -1
-# if Gid_t_SIZE == IVSIZE
-# define Gid_t_f IVdf
-# else
-# if Gid_t_SIZE == LONGSIZE
-# define Gid_t_f "ld"
-# else
-# if Gid_t_SIZE == INTSIZE
-# define Gid_t_f "d"
-# else
-# if Gid_t_SIZE == SHORTSIZE
-# define Gid_t_f "hd"
-# else
- /* You tell me. */
-# endif
-# endif
-# endif
-# endif
-#else
-# if Gid_t_SIZE == UVSIZE
-# define Gid_t_f UVuf
-# else
-# if Gid_t_SIZE == LONGSIZE
-# define Gid_t_f "lu"
-# else
-# if Gid_t_SIZE == INTSIZE
-# define Gid_t_f "u"
-# else
-# if Gid_t_SIZE == SHORTSIZE
-# define Gid_t_f "hu"
-# else
- /* You tell me. */
-# endif
-# endif
-# endif
-# endif
-#endif
-
/* Used with UV/IV arguments: */
/* XXXX: need to speed it up */
#define CLUMP_2UV(iv) ((iv) < 0 ? 0 : (UV)(iv))
#define CLUMP_2IV(uv) ((uv) > (UV)IV_MAX ? IV_MAX : (IV)(uv))
-struct Outrec {
- I32 o_lines;
- char *o_str;
- U32 o_len;
-};
-
#ifndef MAXSYSFD
# define MAXSYSFD 2
#endif
-#ifndef TMPPATH
-# define TMPPATH "/tmp/perl-eXXXXXX"
-#endif
-
#ifndef __cplusplus
Uid_t getuid (void);
Uid_t geteuid (void);
# 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 */
#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
/* 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
#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
*/