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
# include <unistd.h>
#endif
-#if defined(HAS_SOCKET) && !defined(VMS) /* VMS handles sockets via vmsish.h */
-# include <sys/socket.h>
-# if defined(USE_SOCKS) && defined(I_SOCKS)
-# if !defined(INCLUDE_PROTOTYPES)
-# define INCLUDE_PROTOTYPES /* for <socks.h> */
-# define PERL_SOCKS_NEED_PROTOTYPES
-# endif
-# include <socks.h>
-# ifdef PERL_SOCKS_NEED_PROTOTYPES /* keep cpp space clean */
-# undef INCLUDE_PROTOTYPES
-# undef PERL_SOCKS_NEED_PROTOTYPES
-# endif
-# endif
-# ifdef I_NETBSD
-# include <netdb.h>
-# endif
-# ifndef ENOTSOCK
-# ifdef I_NET_ERRNO
-# include <net/errno.h>
-# 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)
#endif
#include <errno.h>
-#ifdef HAS_SOCKET
-# ifdef I_NET_ERRNO
-# include <net/errno.h>
-# endif
+
+#if defined(HAS_SOCKET) && !defined(VMS) /* VMS handles sockets via vmsish.h */
+# include <sys/socket.h>
+# if defined(USE_SOCKS) && defined(I_SOCKS)
+# if !defined(INCLUDE_PROTOTYPES)
+# define INCLUDE_PROTOTYPES /* for <socks.h> */
+# define PERL_SOCKS_NEED_PROTOTYPES
+# endif
+# include <socks.h>
+# ifdef PERL_SOCKS_NEED_PROTOTYPES /* keep cpp space clean */
+# undef INCLUDE_PROTOTYPES
+# undef PERL_SOCKS_NEED_PROTOTYPES
+# endif
+# endif
+# ifdef I_NETDB
+# include <netdb.h>
+# endif
+# ifndef ENOTSOCK
+# ifdef I_NET_ERRNO
+# include <net/errno.h>
+# endif
+# endif
+#endif
+
+#ifdef SETERRNO
+# undef SETERRNO /* SOCKS might have defined this */
#endif
#ifdef VMS
# include <sys/resource.h>
#endif
-#if defined(HAS_SOCKET) && !defined(VMS) /* VMS handles sockets via vmsish.h */
-# include <sys/socket.h>
-# if defined(USE_SOCKS) && defined(I_SOCKS)
-# if !defined(INCLUDE_PROTOTYPES)
-# define INCLUDE_PROTOTYPES /* for <socks.h> */
-# define PERL_SOCKS_NEED_PROTOTYPES
-# endif
-# include <socks.h>
-# ifdef PERL_SOCKS_NEED_PROTOTYPES /* keep cpp space clean */
-# undef INCLUDE_PROTOTYPES
-# undef PERL_SOCKS_NEED_PROTOTYPES
-# endif
-# endif
-# ifdef I_NETDB
-# include <netdb.h>
-# endif
-# ifndef ENOTSOCK
-# ifdef I_NET_ERRNO
-# include <net/errno.h>
-# endif
-# endif
-#endif
-
#ifdef HAS_SELECT
-#ifdef I_SYS_SELECT
-#include <sys/select.h>
-#endif
+# ifdef I_SYS_SELECT
+# include <sys/select.h>
+# endif
#endif
/* XXX Configure test needed.