summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-11-17 08:34:52 +0000
committerNicholas Clark <nick@ccl4.org>2010-11-17 08:36:37 +0000
commit7bff8c334b79055a65ea37cb51de6d9629880b6c (patch)
treef73a3596596171fcd0a666eaafd6aedd21c2dcdd
parentd90d5a3845e854b868ede5476fd329d1fb85fd46 (diff)
downloadperl-7bff8c334b79055a65ea37cb51de6d9629880b6c.tar.gz
Convert newSUB() to a macro wrapping Perl_newATTRSUB()
Provide a Perl_newSUB() function in mathoms.c for anyone referencing it by its full name.
-rw-r--r--embed.fnc3
-rw-r--r--embed.h1
-rw-r--r--mathoms.c7
-rw-r--r--op.c6
-rw-r--r--op.h2
-rw-r--r--proto.h2
6 files changed, 12 insertions, 9 deletions
diff --git a/embed.fnc b/embed.fnc
index a51f148656..1d89b96332 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -794,7 +794,8 @@ Ap |void |newPROG |NN OP* o
Apda |OP* |newRANGE |I32 flags|NN OP* left|NN OP* right
Apda |OP* |newSLICEOP |I32 flags|NULLOK OP* subscript|NULLOK OP* listop
Apda |OP* |newSTATEOP |I32 flags|NULLOK char* label|NULLOK OP* o
-Ap |CV* |newSUB |I32 floor|NULLOK OP* o|NULLOK OP* proto|NULLOK OP* block
+Abm |CV* |newSUB |I32 floor|NULLOK OP* o|NULLOK OP* proto \
+ |NULLOK OP* block
ApM |CV * |newXS_flags |NULLOK const char *name|NN XSUBADDR_t subaddr\
|NN const char *const filename \
|NULLOK const char *const proto|U32 flags
diff --git a/embed.h b/embed.h
index 279683b192..42515dfd34 100644
--- a/embed.h
+++ b/embed.h
@@ -334,7 +334,6 @@
#define newRV_noinc(a) Perl_newRV_noinc(aTHX_ a)
#define newSLICEOP(a,b,c) Perl_newSLICEOP(aTHX_ a,b,c)
#define newSTATEOP(a,b,c) Perl_newSTATEOP(aTHX_ a,b,c)
-#define newSUB(a,b,c,d) Perl_newSUB(aTHX_ a,b,c,d)
#define newSV(a) Perl_newSV(aTHX_ a)
#define newSVOP(a,b,c) Perl_newSVOP(aTHX_ a,b,c)
#define newSVREF(a) Perl_newSVREF(aTHX_ a)
diff --git a/mathoms.c b/mathoms.c
index dac7eae465..32f3215de5 100644
--- a/mathoms.c
+++ b/mathoms.c
@@ -83,6 +83,7 @@ PERL_CALLCONV I32 Perl_my_lstat(pTHX);
PERL_CALLCONV I32 Perl_sv_eq(pTHX_ register SV *sv1, register SV *sv2);
PERL_CALLCONV char * Perl_sv_collxfrm(pTHX_ SV *const sv, STRLEN *const nxp);
PERL_CALLCONV bool Perl_sv_2bool(pTHX_ register SV *const sv);
+PERL_CALLCONV CV * Perl_newSUB(pTHX_ I32 floor, OP* o, OP* proto, OP* block);
/* ref() is now a macro using Perl_doref;
* this version provided for binary compatibility only.
@@ -1582,6 +1583,12 @@ Perl_custom_op_desc(pTHX_ const OP* o)
PERL_ARGS_ASSERT_CUSTOM_OP_DESC;
return XopENTRY(Perl_custom_op_xop(aTHX_ o), xop_desc);
}
+
+CV *
+Perl_newSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *block)
+{
+ return Perl_newATTRSUB(aTHX_ floor, o, proto, NULL, block);
+}
#endif /* NO_MATHOMS */
/*
diff --git a/op.c b/op.c
index 98adf8c18f..2e974fd3fd 100644
--- a/op.c
+++ b/op.c
@@ -6056,12 +6056,6 @@ Perl_newMYSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
}
CV *
-Perl_newSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *block)
-{
- return Perl_newATTRSUB(aTHX_ floor, o, proto, NULL, block);
-}
-
-CV *
Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
{
dVAR;
diff --git a/op.h b/op.h
index 9a5ec94d08..c011d661f9 100644
--- a/op.h
+++ b/op.h
@@ -852,6 +852,8 @@ one of the OA_* constants from op.h.
? XopENTRY(Perl_custom_op_xop(aTHX_ o), xop_class) \
: (PL_opargs[(o)->op_type] & OA_CLASS_MASK))
+#define newSUB(f, o, p, b) Perl_newATTRSUB(aTHX_ (f), (o), (p), NULL, (b))
+
#ifdef PERL_MAD
# define MAD_NULL 1
# define MAD_PV 2
diff --git a/proto.h b/proto.h
index 069c5eb5b6..6679e59dd4 100644
--- a/proto.h
+++ b/proto.h
@@ -2548,7 +2548,7 @@ PERL_CALLCONV OP* Perl_newSTATEOP(pTHX_ I32 flags, char* label, OP* o)
__attribute__malloc__
__attribute__warn_unused_result__;
-PERL_CALLCONV CV* Perl_newSUB(pTHX_ I32 floor, OP* o, OP* proto, OP* block);
+/* PERL_CALLCONV CV* Perl_newSUB(pTHX_ I32 floor, OP* o, OP* proto, OP* block); */
PERL_CALLCONV SV* Perl_newSV(pTHX_ const STRLEN len)
__attribute__malloc__
__attribute__warn_unused_result__;