Skip to content

Commit

Permalink
Remove #ifdef PERL_CUSTOM_OPS, always build with PERL_CUSTOM_OPS
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Artur Bergman committed Sep 10, 2001
1 parent 7a799e2 commit 19e8ce8
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
4 changes: 2 additions & 2 deletions embed.pl
Expand Up @@ -1967,10 +1967,10 @@ END
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
Expand Down
4 changes: 2 additions & 2 deletions intrpvar.h
Expand Up @@ -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. */
1 change: 0 additions & 1 deletion makedef.pl
Expand Up @@ -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(
Expand Down
9 changes: 5 additions & 4 deletions op.c
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -7179,7 +7180,7 @@ char* custom_op_desc(pTHX_ OP* o)

return SvPV_nolen(HeVAL(he));
}
#endif


#include "XSUB.h"

Expand Down
6 changes: 1 addition & 5 deletions opcode.pl
Expand Up @@ -65,15 +65,11 @@ END
START_EXTERN_C
#ifdef PERL_CUSTOM_OPS
#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])
#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[];
Expand Down
2 changes: 2 additions & 0 deletions sv.c
Expand Up @@ -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, '<');
Expand Down

0 comments on commit 19e8ce8

Please sign in to comment.