#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 }
# 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
#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;
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;
IEXT SV * Ilastscream;
/* shortcuts to misc objects */
-IEXT HV * Ierrhv;
-IEXT SV * Ierrsv;
+IEXT GV * Ierrgv;
/* shortcuts to debugging objects */
IEXT GV * IDBgv;
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 */
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 */