X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=opcode.h;h=8e52cf6f6c7a2449e4c2f3fc08906aa548648ea1;hb=27da23d53ccce622bc51822f59df8def79b4df95;hp=4d41ddf53c33534222da59b925e121f2c807c642;hpb=9133b6393363c0c6671c1b2c6b2ecadb3ff402ee;p=p5sagit%2Fp5-mst-13.2.git diff --git a/opcode.h b/opcode.h index 4d41ddf..8e52cf6 100644 --- a/opcode.h +++ b/opcode.h @@ -2,7 +2,7 @@ * opcode.h * * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, - * 2000, 2001, 2002, 2003, by Larry Wall and others + * 2000, 2001, 2002, 2003, 2004, 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,24 +12,24 @@ * will be lost! */ +#ifndef PERL_GLOBAL_STRUCT_INIT + #define Perl_pp_i_preinc Perl_pp_preinc #define Perl_pp_i_predec Perl_pp_predec #define Perl_pp_i_postinc Perl_pp_postinc #define Perl_pp_i_postdec Perl_pp_postdec - START_EXTERN_C - #define OP_NAME(o) ((o)->op_type == OP_CUSTOM ? custom_op_name(o) : \ PL_op_name[(o)->op_type]) #define OP_DESC(o) ((o)->op_type == OP_CUSTOM ? custom_op_desc(o) : \ PL_op_desc[(o)->op_type]) #ifndef DOINIT -EXT char *PL_op_name[]; +EXTCONST char* const PL_op_name[]; #else -EXT char *PL_op_name[] = { +EXTCONST char* const PL_op_name[] = { "null", "stub", "scalar", @@ -388,9 +388,9 @@ EXT char *PL_op_name[] = { #endif #ifndef DOINIT -EXT char *PL_op_desc[]; +EXTCONST char* const PL_op_desc[]; #else -EXT char *PL_op_desc[] = { +EXTCONST char* const PL_op_desc[] = { "null operation", "stub", "scalar", @@ -750,13 +750,20 @@ EXT char *PL_op_desc[] = { END_EXTERN_C +#endif /* !PERL_GLOBAL_STRUCT_INIT */ + START_EXTERN_C -#ifndef DOINIT -EXT OP * (CPERLscope(*PL_ppaddr)[])(pTHX); +#ifdef PERL_GLOBAL_STRUCT_INIT +static const Perl_ppaddr_t Gppaddr[] #else -EXT OP * (CPERLscope(*PL_ppaddr)[])(pTHX) = { +# ifndef PERL_GLOBAL_STRUCT +EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */ +# endif +#endif /* PERL_GLOBAL_STRUCT */ +#if (defined(DOINIT) && !defined(PERL_GLOBAL_STRUCT)) || defined(PERL_GLOBAL_STRUCT_INIT) += { MEMBER_TO_FPTR(Perl_pp_null), MEMBER_TO_FPTR(Perl_pp_stub), MEMBER_TO_FPTR(Perl_pp_scalar), @@ -1110,13 +1117,19 @@ EXT OP * (CPERLscope(*PL_ppaddr)[])(pTHX) = { MEMBER_TO_FPTR(Perl_pp_method_named), MEMBER_TO_FPTR(Perl_pp_dor), MEMBER_TO_FPTR(Perl_pp_dorassign), -}; +} #endif +; -#ifndef DOINIT -EXT OP * (CPERLscope(*PL_check)[]) (pTHX_ OP *op); +#ifdef PERL_GLOBAL_STRUCT_INIT +static const Perl_check_t Gcheck[] #else -EXT OP * (CPERLscope(*PL_check)[]) (pTHX_ OP *op) = { +# ifndef PERL_GLOBAL_STRUCT +EXT Perl_check_t PL_check[] /* or perlvars.h */ +# endif +#endif +#if (defined(DOINIT) && !defined(PERL_GLOBAL_STRUCT)) || defined(PERL_GLOBAL_STRUCT_INIT) += { MEMBER_TO_FPTR(Perl_ck_null), /* null */ MEMBER_TO_FPTR(Perl_ck_null), /* stub */ MEMBER_TO_FPTR(Perl_ck_fun), /* scalar */ @@ -1150,9 +1163,9 @@ EXT OP * (CPERLscope(*PL_check)[]) (pTHX_ OP *op) = { MEMBER_TO_FPTR(Perl_ck_null), /* regcomp */ MEMBER_TO_FPTR(Perl_ck_match), /* match */ MEMBER_TO_FPTR(Perl_ck_match), /* qr */ - MEMBER_TO_FPTR(Perl_ck_null), /* subst */ + MEMBER_TO_FPTR(Perl_ck_match), /* subst */ MEMBER_TO_FPTR(Perl_ck_null), /* substcont */ - MEMBER_TO_FPTR(Perl_ck_null), /* trans */ + MEMBER_TO_FPTR(Perl_ck_match), /* trans */ MEMBER_TO_FPTR(Perl_ck_sassign), /* sassign */ MEMBER_TO_FPTR(Perl_ck_null), /* aassign */ MEMBER_TO_FPTR(Perl_ck_spair), /* chop */ @@ -1254,7 +1267,7 @@ EXT OP * (CPERLscope(*PL_check)[]) (pTHX_ OP *op) = { MEMBER_TO_FPTR(Perl_ck_rvconst), /* rv2hv */ MEMBER_TO_FPTR(Perl_ck_null), /* helem */ MEMBER_TO_FPTR(Perl_ck_null), /* hslice */ - MEMBER_TO_FPTR(Perl_ck_fun), /* unpack */ + MEMBER_TO_FPTR(Perl_ck_unpack), /* unpack */ MEMBER_TO_FPTR(Perl_ck_fun), /* pack */ MEMBER_TO_FPTR(Perl_ck_split), /* split */ MEMBER_TO_FPTR(Perl_ck_join), /* join */ @@ -1471,13 +1484,16 @@ EXT OP * (CPERLscope(*PL_check)[]) (pTHX_ OP *op) = { MEMBER_TO_FPTR(Perl_ck_null), /* dor */ MEMBER_TO_FPTR(Perl_ck_null), /* dorassign */ MEMBER_TO_FPTR(Perl_ck_null), /* custom */ -}; +} #endif +; + +#ifndef PERL_GLOBAL_STRUCT_INIT #ifndef DOINIT -EXT U32 PL_opargs[]; +EXT const U32 PL_opargs[]; #else -EXT U32 PL_opargs[] = { +EXT const U32 PL_opargs[] = { 0x00000000, /* null */ 0x00000000, /* stub */ 0x00003604, /* scalar */ @@ -1544,7 +1560,7 @@ EXT U32 PL_opargs[] = { 0x0002251e, /* i_add */ 0x0002252e, /* subtract */ 0x0002251e, /* i_subtract */ - 0x0002240e, /* concat */ + 0x0002250e, /* concat */ 0x0000290e, /* stringify */ 0x0002250e, /* left_shift */ 0x0002250e, /* right_shift */ @@ -1836,3 +1852,5 @@ EXT U32 PL_opargs[] = { #endif END_EXTERN_C + +#endif /* !PERL_GLOBAL_STRUCT_INIT */