This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Generate "Unsupported socket function" stubs using PL_ppaddr.
authorNicholas Clark <nick@ccl4.org>
Sat, 8 Jan 2011 15:56:22 +0000 (15:56 +0000)
committerNicholas Clark <nick@ccl4.org>
Sun, 9 Jan 2011 17:28:17 +0000 (17:28 +0000)
commit7627e6d0fe772ac90fce9e03fea273109521e261
tree9317d21d802d44a74aa30b150729dc10a3662835
parent60504e186da3226f64f36cdc4c9e700993e6f372
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.
opcode.h
pp.c
pp_sys.c
regen/opcode.pl