summaryrefslogtreecommitdiff
path: root/opcode.h
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 /opcode.h
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 'opcode.h')
-rw-r--r--opcode.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/opcode.h b/opcode.h
index 33b485cf8b..8cc671a806 100644
--- a/opcode.h
+++ b/opcode.h
@@ -53,11 +53,29 @@
#define Perl_pp_say Perl_pp_print
#define Perl_pp_seek Perl_pp_sysseek
#define Perl_pp_fcntl Perl_pp_ioctl
+#ifdef HAS_SOCKET
#define Perl_pp_send Perl_pp_syswrite
#define Perl_pp_recv Perl_pp_sysread
+#else
+#define Perl_pp_send Perl_unimplemented_op
+#define Perl_pp_recv Perl_unimplemented_op
+#define Perl_pp_socket Perl_unimplemented_op
+#endif
+#ifdef HAS_SOCKET
#define Perl_pp_connect Perl_pp_bind
#define Perl_pp_gsockopt Perl_pp_ssockopt
#define Perl_pp_getsockname Perl_pp_getpeername
+#else
+#define Perl_pp_bind Perl_unimplemented_op
+#define Perl_pp_connect Perl_unimplemented_op
+#define Perl_pp_listen Perl_unimplemented_op
+#define Perl_pp_accept Perl_unimplemented_op
+#define Perl_pp_shutdown Perl_unimplemented_op
+#define Perl_pp_gsockopt Perl_unimplemented_op
+#define Perl_pp_ssockopt Perl_unimplemented_op
+#define Perl_pp_getsockname Perl_unimplemented_op
+#define Perl_pp_getpeername Perl_unimplemented_op
+#endif
#define Perl_pp_lstat Perl_pp_stat
#define Perl_pp_ftrwrite Perl_pp_ftrread
#define Perl_pp_ftrexec Perl_pp_ftrread