From: Jens Hamisch Date: Tue, 14 Nov 2000 11:34:40 +0000 (+0100) Subject: Hoist the duplicated socket/netdb include logic to perl.h; X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1e743fda37685ecafb0bc463ccd70b605724c884;p=p5sagit%2Fp5-mst-13.2.git Hoist the duplicated socket/netdb include logic to perl.h; undef SETERRNO in case SOCKS has defined it. Based on: Subject: [ID 20001114.002] Code-Cleanups concerning SOCKS5 and Solaris Message-Id: <20001114113440.A20005@Strawberry.COM> p4raw-id: //depot/perl@7683 --- diff --git a/doio.c b/doio.c index 87e53a4..e4724ef 100644 --- a/doio.c +++ b/doio.c @@ -56,29 +56,6 @@ # include #endif -#if defined(HAS_SOCKET) && !defined(VMS) /* VMS handles sockets via vmsish.h */ -# include -# if defined(USE_SOCKS) && defined(I_SOCKS) -# if !defined(INCLUDE_PROTOTYPES) -# define INCLUDE_PROTOTYPES /* for */ -# define PERL_SOCKS_NEED_PROTOTYPES -# endif -# include -# ifdef PERL_SOCKS_NEED_PROTOTYPES /* keep cpp space clean */ -# undef INCLUDE_PROTOTYPES -# undef PERL_SOCKS_NEED_PROTOTYPES -# endif -# endif -# ifdef I_NETBSD -# include -# endif -# ifndef ENOTSOCK -# ifdef I_NET_ERRNO -# include -# endif -# endif -#endif - bool Perl_do_open(pTHX_ GV *gv, register char *name, I32 len, int as_raw, int rawmode, int rawperm, PerlIO *supplied_fp) diff --git a/perl.h b/perl.h index 6f822dc..f932198 100644 --- a/perl.h +++ b/perl.h @@ -709,10 +709,32 @@ typedef struct perl_mstats perl_mstats_t; #endif #include -#ifdef HAS_SOCKET -# ifdef I_NET_ERRNO -# include -# endif + +#if defined(HAS_SOCKET) && !defined(VMS) /* VMS handles sockets via vmsish.h */ +# include +# if defined(USE_SOCKS) && defined(I_SOCKS) +# if !defined(INCLUDE_PROTOTYPES) +# define INCLUDE_PROTOTYPES /* for */ +# define PERL_SOCKS_NEED_PROTOTYPES +# endif +# include +# ifdef PERL_SOCKS_NEED_PROTOTYPES /* keep cpp space clean */ +# undef INCLUDE_PROTOTYPES +# undef PERL_SOCKS_NEED_PROTOTYPES +# endif +# endif +# ifdef I_NETDB +# include +# endif +# ifndef ENOTSOCK +# ifdef I_NET_ERRNO +# include +# endif +# endif +#endif + +#ifdef SETERRNO +# undef SETERRNO /* SOCKS might have defined this */ #endif #ifdef VMS diff --git a/pp_sys.c b/pp_sys.c index 4b8bfce..43b3f66 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -54,33 +54,10 @@ extern "C" int syscall(unsigned long,...); # include #endif -#if defined(HAS_SOCKET) && !defined(VMS) /* VMS handles sockets via vmsish.h */ -# include -# if defined(USE_SOCKS) && defined(I_SOCKS) -# if !defined(INCLUDE_PROTOTYPES) -# define INCLUDE_PROTOTYPES /* for */ -# define PERL_SOCKS_NEED_PROTOTYPES -# endif -# include -# ifdef PERL_SOCKS_NEED_PROTOTYPES /* keep cpp space clean */ -# undef INCLUDE_PROTOTYPES -# undef PERL_SOCKS_NEED_PROTOTYPES -# endif -# endif -# ifdef I_NETDB -# include -# endif -# ifndef ENOTSOCK -# ifdef I_NET_ERRNO -# include -# endif -# endif -#endif - #ifdef HAS_SELECT -#ifdef I_SYS_SELECT -#include -#endif +# ifdef I_SYS_SELECT +# include +# endif #endif /* XXX Configure test needed.