Skip to content

Commit 1d6cadf

Browse files
committed
op.h: Restrict to core certain internal symbols
so that they aren't accessible to XS code and won't be picked up by autodoc
1 parent c2b527b commit 1d6cadf

File tree

1 file changed

+27
-24
lines changed

1 file changed

+27
-24
lines changed

op.h

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -458,30 +458,31 @@ struct loop {
458458
#define cCOP cCOPx(PL_op)
459459
#define cLOOP cLOOPx(PL_op)
460460

461-
#define cUNOPo cUNOPx(o)
462-
#define cUNOP_AUXo cUNOP_AUXx(o)
463-
#define cBINOPo cBINOPx(o)
464-
#define cLISTOPo cLISTOPx(o)
465-
#define cLOGOPo cLOGOPx(o)
466-
#define cPMOPo cPMOPx(o)
467-
#define cSVOPo cSVOPx(o)
468-
#define cPADOPo cPADOPx(o)
469-
#define cPVOPo cPVOPx(o)
470-
#define cCOPo cCOPx(o)
471-
#define cLOOPo cLOOPx(o)
472-
473-
#define kUNOP cUNOPx(kid)
474-
#define kUNOP_AUX cUNOP_AUXx(kid)
475-
#define kBINOP cBINOPx(kid)
476-
#define kLISTOP cLISTOPx(kid)
477-
#define kLOGOP cLOGOPx(kid)
478-
#define kPMOP cPMOPx(kid)
479-
#define kSVOP cSVOPx(kid)
480-
#define kPADOP cPADOPx(kid)
481-
#define kPVOP cPVOPx(kid)
482-
#define kCOP cCOPx(kid)
483-
#define kLOOP cLOOPx(kid)
484-
461+
#if defined(PERL_CORE) || defined(PERL_EXT)
462+
# define cUNOPo cUNOPx(o)
463+
# define cUNOP_AUXo cUNOP_AUXx(o)
464+
# define cBINOPo cBINOPx(o)
465+
# define cLISTOPo cLISTOPx(o)
466+
# define cLOGOPo cLOGOPx(o)
467+
# define cPMOPo cPMOPx(o)
468+
# define cSVOPo cSVOPx(o)
469+
# define cPADOPo cPADOPx(o)
470+
# define cPVOPo cPVOPx(o)
471+
# define cCOPo cCOPx(o)
472+
# define cLOOPo cLOOPx(o)
473+
474+
# define kUNOP cUNOPx(kid)
475+
# define kUNOP_AUX cUNOP_AUXx(kid)
476+
# define kBINOP cBINOPx(kid)
477+
# define kLISTOP cLISTOPx(kid)
478+
# define kLOGOP cLOGOPx(kid)
479+
# define kPMOP cPMOPx(kid)
480+
# define kSVOP cSVOPx(kid)
481+
# define kPADOP cPADOPx(kid)
482+
# define kPVOP cPVOPx(kid)
483+
# define kCOP cCOPx(kid)
484+
# define kLOOP cLOOPx(kid)
485+
#endif
485486

486487
typedef enum {
487488
OPclass_NULL, /* 0 */
@@ -526,12 +527,14 @@ typedef enum {
526527

527528
#define cMETHOPx_meth(v) cSVOPx_sv(v)
528529

530+
#if defined(PERL_CORE) || defined(PERL_EXT_RE_BUILD)
529531
#define cGVOP_gv cGVOPx_gv(PL_op)
530532
#define cGVOPo_gv cGVOPx_gv(o)
531533
#define kGVOP_gv cGVOPx_gv(kid)
532534
#define cSVOP_sv cSVOPx_sv(PL_op)
533535
#define cSVOPo_sv cSVOPx_sv(o)
534536
#define kSVOP_sv cSVOPx_sv(kid)
537+
#endif
535538

536539
#ifndef PERL_CORE
537540
# define Nullop ((OP*)NULL)

0 commit comments

Comments
 (0)