summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>1997-12-01 02:54:29 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>1997-12-01 02:54:29 +0000
commit22239a37ce131e4f5341aee571f08aced283e16a (patch)
tree8f7f8e19354cc72b2f70b0f4bee40968a002c92b /perl.h
parent36c15d3fd87bb94724027176c49a6c0afbc14dc9 (diff)
downloadperl-22239a37ce131e4f5341aee571f08aced283e16a.tar.gz
Create a struct for all perls globals (as an option)
Mainly for Mingw32 which cannot import data. Now only Opcode tests fail (op_desc/op_name not handled yet stuff) p4raw-id: //depot/ansiperl@341
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h46
1 files changed, 31 insertions, 15 deletions
diff --git a/perl.h b/perl.h
index c5298fa201..09d64af3e6 100644
--- a/perl.h
+++ b/perl.h
@@ -1613,6 +1613,27 @@ typedef enum {
#define RsSIMPLE(sv) (SvOK(sv) && SvCUR(sv))
#define RsPARA(sv) (SvOK(sv) && ! SvCUR(sv))
+/* Set up PERLVAR macros for populating structs */
+#define PERLVAR(var,type) type var;
+#define PERLVARI(var,type,init) type var;
+
+#ifdef PERL_GLOBAL_STRUCT
+struct perl_vars {
+#include "perlvars.h"
+};
+
+#ifdef PERL_CORE
+EXT struct perl_vars Perl_Vars;
+EXT struct perl_vars *Perl_VarsPtr INIT(&Perl_Vars);
+#else
+#if !defined(__GNUC__) || !defined(WIN32)
+EXT
+#endif
+struct perl_vars *Perl_VarsPtr;
+#define Perl_Vars (*((Perl_VarsPtr) ? Perl_VarsPtr : (Perl_VarsPtr = Perl_GetVars())))
+#endif
+#endif /* PERL_GLOBAL_STRUCT */
+
#ifdef MULTIPLICITY
/* If we have multiple interpreters define a struct
holding variables which must be per-interpreter
@@ -1620,9 +1641,6 @@ typedef enum {
be per-thread is per-interpreter.
*/
-#define PERLVAR(var,type) type var;
-#define PERLVARI(var,type,init) type var;
-
struct interpreter {
#ifndef USE_THREADS
#include "thrdvar.h"
@@ -1630,9 +1648,6 @@ struct interpreter {
#include "intrpvar.h"
};
-#undef PERLVAR
-#undef PERLVARI
-
#else
struct interpreter {
char broiled;
@@ -1644,25 +1659,22 @@ struct interpreter {
* that have to be per-thread
*/
-#define PERLVAR(var,type) type var;
-#define PERLVARI(var,type,init) type var;
struct perl_thread {
#include "thrdvar.h"
};
+#endif
+
+/* Done with PERLVAR macros for now ... */
#undef PERLVAR
#undef PERLVARI
-#endif
typedef struct perl_thread *Thread;
-#include "thread.h"
+#include "thread.h"
#include "pp.h"
-
-START_EXTERN_C
#include "proto.h"
-END_EXTERN_C
#ifdef EMBED
#define Perl_sv_setptrobj(rv,ptr,name) Perl_sv_setref_iv(rv,name,(IV)ptr)
@@ -1684,16 +1696,20 @@ END_EXTERN_C
#define PERLVAR(var,type) EXT type var;
#define PERLVARI(var,type,init) EXT type var INIT(init);
+#ifndef PERL_GLOBAL_STRUCT
#include "perlvars.h"
+#endif
#ifndef MULTIPLICITY
-#include "intrpvar.h"
-#endif
#ifndef USE_THREADS
#include "thrdvar.h"
#endif
+#include "intrpvar.h"
+#endif
+
+
#undef PERLVAR
#undef PERLVARI