diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 1997-12-01 02:54:29 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 1997-12-01 02:54:29 +0000 |
commit | 22239a37ce131e4f5341aee571f08aced283e16a (patch) | |
tree | 8f7f8e19354cc72b2f70b0f4bee40968a002c92b /embed.pl | |
parent | 36c15d3fd87bb94724027176c49a6c0afbc14dc9 (diff) | |
download | perl-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 'embed.pl')
-rwxr-xr-x | embed.pl | 54 |
1 files changed, 48 insertions, 6 deletions
@@ -29,7 +29,7 @@ sub readvars(\%$$) { while (<FILE>) { s/[ \t]*#.*//; # Delete comments. if (/PERLVARI?\($pre(\w+)/) { - $$syms{$1} = $pre; + $$syms{$1} = 1; } } close(FILE); @@ -40,7 +40,7 @@ my %thread; readvars %intrp, 'intrpvar.h','I'; readvars %thread, 'thrdvar.h','T'; -#readvars %global, 'perlvars.h',''; +readvars %globvar, 'perlvars.h','G'; foreach my $sym (sort keys %intrp) { @@ -52,6 +52,15 @@ foreach my $sym (sort keys %intrp) } } +foreach my $sym (sort keys %globvar) + { + if (exists $global{$sym}) + { + delete $global{$sym}; + warn "$sym in global.sym as well as perlvars.h\n"; + } + } + foreach my $sym (keys %interp) { warn "extra $sym in interp.sym\n" @@ -79,7 +88,7 @@ sub embed ($) { } sub multon ($$$) { my ($sym,$pre,$ptr) = @_; - hide($sym, "($ptr->$pre$sym)"); + hide($sym, "($ptr$pre$sym)"); } sub multoff ($$) { my ($sym,$pre) = @_; @@ -156,7 +165,7 @@ print EM <<'END'; END for $sym (sort keys %thread) { - print EM multon($sym,'T','curinterp'); + print EM multon($sym,'T','curinterp->'); } print EM <<'END'; @@ -168,7 +177,7 @@ print EM <<'END'; END for $sym (sort keys %intrp) { - print EM multon($sym,'I','curinterp'); + print EM multon($sym,'I','curinterp->'); } print EM <<'END'; @@ -228,13 +237,46 @@ print EM <<'END'; END for $sym (sort keys %thread) { - print EM multon($sym,'T','thr'); + print EM multon($sym,'T','thr->'); } print EM <<'END'; #endif /* USE_THREADS */ +#ifdef PERL_GLOBAL_STRUCT + +END + +for $sym (sort keys %globvar) { + print EM multon($sym,'G','Perl_Vars.'); +} + +print EM <<'END'; + +#else /* !PERL_GLOBAL_STRUCT */ + +END + +for $sym (sort keys %globvar) { + print EM multoff($sym,'G'); +} + +print EM <<'END'; + +#ifdef EMBED + +END + +for $sym (sort keys %globvar) { + print EM embed($sym); +} + +print EM <<'END'; + +#endif /* EMBED */ +#endif /* PERL_GLOBAL_STRUCT */ + END close(EM);
\ No newline at end of file |