diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2005-04-18 16:18:30 +0300 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-04-21 15:38:30 +0000 |
commit | 27da23d53ccce622bc51822f59df8def79b4df95 (patch) | |
tree | 1202440e0fbf7a2fc1bb54993d11cda7b245f1b4 /embed.pl | |
parent | ec0624293b57ae07d6b2c32bae099d4f163e7e07 (diff) | |
download | perl-27da23d53ccce622bc51822f59df8def79b4df95.tar.gz |
Symbian port of Perl
Message-ID: <B356D8F434D20B40A8CEDAEC305A1F2453D653@esebe105.NOE.Nokia.com>
p4raw-id: //depot/perl@24271
Diffstat (limited to 'embed.pl')
-rwxr-xr-x | embed.pl | 61 |
1 files changed, 52 insertions, 9 deletions
@@ -274,7 +274,7 @@ sub readvars(\%$$@) { or die "embed.pl: Can't open $file: $!\n"; while (<FILE>) { s/[ \t]*#.*//; # Delete comments. - if (/PERLVARA?I?C?\($pre(\w+)/) { + if (/PERLVARA?I?S?C?\($pre(\w+)/) { my $sym = $1; $sym = $pre . $sym if $keep_pre; warn "duplicate symbol $sym while processing $file\n" @@ -609,7 +609,8 @@ print EM <<'END'; END for $sym (sort keys %globvar) { - print EM multon($sym,'G','PL_Vars.'); + print EM multon($sym, 'G','my_vars->'); + print EM multon("G$sym",'', 'my_vars->'); } print EM <<'END'; @@ -662,11 +663,14 @@ START_EXTERN_C #undef PERLVARA #undef PERLVARI #undef PERLVARIC +#undef PERLVARISC #define PERLVAR(v,t) EXTERN_C t* Perl_##v##_ptr(pTHX); #define PERLVARA(v,n,t) typedef t PL_##v##_t[n]; \ EXTERN_C PL_##v##_t* Perl_##v##_ptr(pTHX); #define PERLVARI(v,t,i) PERLVAR(v,t) #define PERLVARIC(v,t,i) PERLVAR(v, const t) +#define PERLVARISC(v,i) typedef const char PL_##v##_t[sizeof(i)]; \ + EXTERN_C PL_##v##_t* Perl_##v##_ptr(pTHX); #include "thrdvar.h" #include "intrpvar.h" @@ -676,6 +680,16 @@ START_EXTERN_C #undef PERLVARA #undef PERLVARI #undef PERLVARIC +#undef PERLVARISC + +#ifndef PERL_GLOBAL_STRUCT +EXTERN_C Perl_ppaddr_t** Perl_Gppaddr_ptr(pTHX); +EXTERN_C Perl_check_t** Perl_Gcheck_ptr(pTHX); +EXTERN_C unsigned char** Perl_Gfold_locale_ptr(pTHX); +#define Perl_ppaddr_ptr Perl_Gppaddr_ptr +#define Perl_check_ptr Perl_Gcheck_ptr +#define Perl_fold_locale_ptr Perl_Gfold_locale_ptr +#endif END_EXTERN_C @@ -691,9 +705,9 @@ END_EXTERN_C START_EXTERN_C #ifndef DOINIT -EXT void *PL_force_link_funcs[]; +EXTCONST void * const PL_force_link_funcs[]; #else -EXT void *PL_force_link_funcs[] = { +EXTCONST void * const PL_force_link_funcs[] = { #undef PERLVAR #undef PERLVARA #undef PERLVARI @@ -702,6 +716,7 @@ EXT void *PL_force_link_funcs[] = { #define PERLVARA(v,n,t) PERLVAR(v,t) #define PERLVARI(v,t,i) PERLVAR(v,t) #define PERLVARIC(v,t,i) PERLVAR(v,t) +#define PERLVARISC(v,i) PERLVAR(v,char) #include "thrdvar.h" #include "intrpvar.h" @@ -711,6 +726,7 @@ EXT void *PL_force_link_funcs[] = { #undef PERLVARA #undef PERLVARI #undef PERLVARIC +#undef PERLVARISC }; #endif /* DOINIT */ @@ -759,14 +775,17 @@ START_EXTERN_C #undef PERLVARA #undef PERLVARI #undef PERLVARIC +#undef PERLVARISC #define PERLVAR(v,t) t* Perl_##v##_ptr(pTHX) \ - { return &(aTHX->v); } + { dVAR; return &(aTHX->v); } #define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHX) \ - { return &(aTHX->v); } + { dVAR; return &(aTHX->v); } #define PERLVARI(v,t,i) PERLVAR(v,t) #define PERLVARIC(v,t,i) PERLVAR(v, const t) +#define PERLVARISC(v,i) PL_##v##_t* Perl_##v##_ptr(pTHX) \ + { dVAR; return &(aTHX->v); } #include "thrdvar.h" #include "intrpvar.h" @@ -774,18 +793,42 @@ START_EXTERN_C #undef PERLVAR #undef PERLVARA #define PERLVAR(v,t) t* Perl_##v##_ptr(pTHX) \ - { return &(PL_##v); } + { dVAR; return &(PL_##v); } #define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHX) \ - { return &(PL_##v); } + { dVAR; return &(PL_##v); } #undef PERLVARIC -#define PERLVARIC(v,t,i) const t* Perl_##v##_ptr(pTHX) \ +#undef PERLVARISC +#define PERLVARIC(v,t,i) \ + const t* Perl_##v##_ptr(pTHX) \ { return (const t *)&(PL_##v); } +#define PERLVARISC(v,i) PL_##v##_t* Perl_##v##_ptr(pTHX) \ + { dVAR; return &(PL_##v); } #include "perlvars.h" #undef PERLVAR #undef PERLVARA #undef PERLVARI #undef PERLVARIC +#undef PERLVARISC + +#ifndef PERL_GLOBAL_STRUCT +/* A few evil special cases. Could probably macrofy this. */ +#undef PL_ppaddr +#undef PL_check +#undef PL_fold_locale +Perl_ppaddr_t** Perl_Gppaddr_ptr(pTHX) { + static const Perl_ppaddr_t* ppaddr_ptr = PL_ppaddr; + return (Perl_ppaddr_t**)&ppaddr_ptr; +} +Perl_check_t** Perl_Gcheck_ptr(pTHX) { + static const Perl_check_t* check_ptr = PL_check; + return (Perl_check_t**)&check_ptr; +} +unsigned char** Perl_Gfold_locale_ptr(pTHX) { + static const unsigned char* fold_locale_ptr = PL_fold_locale; + return (unsigned char**)&fold_locale_ptr; +} +#endif END_EXTERN_C |