Integrate mainline changes into win32 branch. Now would be a good time
[p5sagit/p5-mst-13.2.git] / perl.h
diff --git a/perl.h b/perl.h
index fb17755..a2f5630 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -29,6 +29,9 @@
 
 #include "embed.h"
 
+#undef START_EXTERN_C
+#undef END_EXTERN_C
+#undef EXTERN_C
 #ifdef __cplusplus
 #  define START_EXTERN_C extern "C" {
 #  define END_EXTERN_C }
@@ -462,6 +465,14 @@ register struct op *op asm(stringify(OP_IN_REGISTER));
 #   define SETERRNO(errcode,vmserrcode) errno = (errcode)
 #endif
 
+#ifdef USE_THREADS
+#  define ERRSV (thr->errsv)
+#  define ERRHV (thr->errhv)
+#else
+#  define ERRSV GvSV(errgv)
+#  define ERRHV GvHV(errgv)
+#endif /* USE_THREADS */
+
 #ifndef errno
        extern int errno;     /* ANSI allows errno to be an lvalue expr */
 #endif
@@ -873,11 +884,6 @@ register struct op *op asm(stringify(OP_IN_REGISTER));
 
 #endif
 
-/* Digital UNIX defines a typedef CONTEXT when pthreads is in use */ 
-#if defined(__osf__)
-#  define CONTEXT PERL_CONTEXT
-#endif
-
 typedef MEM_SIZE STRLEN;
 
 typedef struct op OP;
@@ -906,7 +912,7 @@ typedef struct regexp REGEXP;
 typedef struct gp GP;
 typedef struct gv GV;
 typedef struct io IO;
-typedef struct context CONTEXT;
+typedef struct context PERL_CONTEXT;
 typedef struct block BLOCK;
 
 typedef struct magic MAGIC;
@@ -1367,6 +1373,7 @@ EXT struct thread *       eval_owner;     /* Owner thread for doeval */
 EXT int                        nthreads;       /* Number of threads currently */
 EXT perl_mutex         threads_mutex;  /* Mutex for nthreads and thread list */
 EXT perl_cond          nthreads_cond;  /* Condition variable for nthreads */
+EXT char *             per_thread_magicals INIT(PER_THREAD_MAGICALS);
 #ifdef FAKE_THREADS
 EXT struct thread *    thr;            /* Currently executing (fake) thread */
 #endif
@@ -1885,6 +1892,7 @@ IEXT AV * Idbargs;        /* args to call listed by caller function */
 IEXT HV *      Idefstash;      /* main symbol table */
 IEXT HV *      Icurstash;      /* symbol table for current package */
 IEXT HV *      Idebstash;      /* symbol table for perldb package */
+IEXT HV *      Iglobalstash;   /* global keyword overrides imported here */
 IEXT SV *      Icurstname;     /* name of current package */
 IEXT AV *      Ibeginav;       /* names of BEGIN subroutines */
 IEXT AV *      Iendav;         /* names of END subroutines */
@@ -1936,12 +1944,11 @@ IEXT OP *       Ieval_start;
 IEXT COP * VOL Icurcop IINIT(&compiling);
 IEXT COP *     Icurcopdb IINIT(NULL);
 IEXT line_t    Icopline IINIT(NOLINE);
-IEXT CONTEXT * Icxstack;
+IEXT PERL_CONTEXT *    Icxstack;
 IEXT I32       Icxstack_ix IINIT(-1);
 IEXT I32       Icxstack_max IINIT(128);
 IEXT JMPENV    Istart_env;     /* empty startup sigjmp() environment */
 IEXT JMPENV *  Itop_env;       /* ptr. to current sigjmp() environment */
-IEXT I32       Irunlevel;
 
 /* stack stuff */
 IEXT AV *      Icurstack;              /* THE STACK */