summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-01-08 15:56:22 +0000
committerNicholas Clark <nick@ccl4.org>2011-01-09 17:28:17 +0000
commit7627e6d0fe772ac90fce9e03fea273109521e261 (patch)
tree9317d21d802d44a74aa30b150729dc10a3662835 /pp.c
parent60504e186da3226f64f36cdc4c9e700993e6f372 (diff)
downloadperl-7627e6d0fe772ac90fce9e03fea273109521e261.tar.gz
Generate "Unsupported socket function" stubs using PL_ppaddr.
Instead of having each socket op conditionally compile as either the implementation or a DIE() depending on #HAS_SOCKET 1: remove the conditional code from the ops themselves 2: only compile the ops if HAS_SOCKET is defined 3: general conditional code for the intialisation of PL_ppaddr - as appropriate either the ops, or Perl_unimplemented_op 4: Amend Perl_unimplemented_op to generate the appropriate DIE() for socket ops (ie not the "panic"... message) Whilst this complicates the support code in regen/opcode.pl, it's already a net saving of 5 lines in the C code.
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/pp.c b/pp.c
index ba12f6c84c..df28740929 100644
--- a/pp.c
+++ b/pp.c
@@ -6306,6 +6306,8 @@ PP(unimplemented_op)
NULL doesn't generate a useful error message. "custom" does. */
const char *const name = op_type >= OP_max
? "[out of range]" : PL_op_name[PL_op->op_type];
+ if(OP_IS_SOCKET(op_type))
+ DIE(aTHX_ PL_no_sock_func, name);
DIE(aTHX_ "panic: unimplemented op %s (#%d) called", name, op_type);
}