diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-01-08 15:56:22 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-01-09 17:28:17 +0000 |
commit | 7627e6d0fe772ac90fce9e03fea273109521e261 (patch) | |
tree | 9317d21d802d44a74aa30b150729dc10a3662835 /pp.c | |
parent | 60504e186da3226f64f36cdc4c9e700993e6f372 (diff) | |
download | perl-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.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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); } |