X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=perlapi.c;h=a1315984710cf8b60c788579dcb52b731c4ac8d1;hb=c48e04e60e0b6832c6f967240cc478d08e77d54f;hp=83d30a9477b0367f51bca12c414a5b8c8497a6d1;hpb=8fa7688f7865696bdfa78bc12d4ffb78bd1d6103;p=p5sagit%2Fp5-mst-13.2.git diff --git a/perlapi.c b/perlapi.c index 83d30a9..a131598 100644 --- a/perlapi.c +++ b/perlapi.c @@ -1,7 +1,9 @@ -/* +/* -*- buffer-read-only: t -*- + * * perlapi.c * - * Copyright (c) 1997-2003, Larry Wall + * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, + * 2000, 2001, 2002, 2003, 2004, 2005, by Larry Wall and others * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -12,6 +14,12 @@ * Any changes made here will be lost! * * Edit those files and run 'make regen_headers' to effect changes. + * + * + * Up to the threshold of the door there mounted a flight of twenty-seven + * broad stairs, hewn by some unknown art of the same black stone. This + * was the only entrance to the tower. + * */ #include "EXTERN.h" @@ -27,14 +35,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" @@ -42,19 +53,45 @@ 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 #endif /* MULTIPLICITY */ + +/* ex: set ro: */