From: Artur Bergman Date: Mon, 10 Sep 2001 10:02:51 +0000 (+0000) Subject: Remove #ifdef PERL_CUSTOM_OPS, always build with PERL_CUSTOM_OPS X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=19e8ce8e5f1ac60deced7aff63c00270eec46957;p=p5sagit%2Fp5-mst-13.2.git Remove #ifdef PERL_CUSTOM_OPS, always build with PERL_CUSTOM_OPS Rename to custop_op_name to Perl_custom_op_name to match perlapi Clone the hashtable PL_custom_op_names and PL_custop_op_descs in perl_clone. p4raw-id: //depot/perl@11968 --- diff --git a/embed.pl b/embed.pl index fa0a639..bbb03c3 100755 --- a/embed.pl +++ b/embed.pl @@ -1967,10 +1967,10 @@ Ap |void |ptr_table_free|PTR_TBL_t *tbl Ap |void |sys_intern_clear Ap |void |sys_intern_init #endif -#if defined(PERL_CUSTOM_OPS) + Ap |char * |custom_op_name|OP* op Ap |char * |custom_op_desc|OP* op -#endif + END_EXTERN_C diff --git a/intrpvar.h b/intrpvar.h index fd39a09..1559aaa 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -487,10 +487,10 @@ PERLVAR(Ireentrant_buffer, REBUF*) /* here we store the _r buffers */ PERLVAR(Isavebegin, bool) /* save BEGINs for compiler */ -#ifdef PERL_CUSTOM_OPS + PERLVAR(Icustom_op_names, HV*) /* Names of user defined ops */ PERLVAR(Icustom_op_descs, HV*) /* Descriptions of user defined ops */ -#endif + /* New variables must be added to the very end for binary compatibility. * XSUB.h provides wrapper functions via perlapi.h that make this * irrelevant, but not all code may be expected to #include XSUB.h. */ diff --git a/makedef.pl b/makedef.pl index 70f9471..2b8e636b 100644 --- a/makedef.pl +++ b/makedef.pl @@ -200,7 +200,6 @@ sub emit_symbols { } } -skip_symbols [qw(Perl_custom_op_name Perl_custom_op_desc PL_custom_op_descs PL_custom_op_names)] unless $define{'PERL_CUSTOM_OPS'}; if ($PLATFORM eq 'win32') { skip_symbols [qw( diff --git a/op.c b/op.c index eba48b9..daf66bb 100644 --- a/op.c +++ b/op.c @@ -7143,8 +7143,9 @@ Perl_peep(pTHX_ register OP *o) LEAVE; } -#ifdef PERL_CUSTOM_OPS -char* custom_op_name(pTHX_ OP* o) + + +char* Perl_custom_op_name(pTHX_ OP* o) { IV index = PTR2IV(o->op_ppaddr); SV* keysv; @@ -7162,7 +7163,7 @@ char* custom_op_name(pTHX_ OP* o) return SvPV_nolen(HeVAL(he)); } -char* custom_op_desc(pTHX_ OP* o) +char* Perl_custom_op_desc(pTHX_ OP* o) { IV index = PTR2IV(o->op_ppaddr); SV* keysv; @@ -7179,7 +7180,7 @@ char* custom_op_desc(pTHX_ OP* o) return SvPV_nolen(HeVAL(he)); } -#endif + #include "XSUB.h" diff --git a/opcode.pl b/opcode.pl index 2e08641..297a32b 100755 --- a/opcode.pl +++ b/opcode.pl @@ -65,15 +65,11 @@ print <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]) -#else -#define OP_NAME(o) PL_op_name[o->op_type] -#define OP_DESC(o) PL_op_desc[o->op_type] -#endif #ifndef DOINIT EXT char *PL_op_name[]; diff --git a/sv.c b/sv.c index 9f9d105..c0d77b2 100644 --- a/sv.c +++ b/sv.c @@ -9894,6 +9894,8 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags, else PL_exitlist = (PerlExitListEntry*)NULL; PL_modglobal = hv_dup_inc(proto_perl->Imodglobal, param); + PL_custom_op_names = hv_dup_inc(proto_perl->Icustom_op_names,param); + PL_custom_op_descs = hv_dup_inc(proto_perl->Icustom_op_descs,param); PL_profiledata = NULL; PL_rsfp = fp_dup(proto_perl->Irsfp, '<');