Integrate #16971 from maint-5.6;
Jarkko Hietaniemi [Sat, 1 Jun 2002 21:19:50 +0000 (21:19 +0000)]
IO::Poll wasn't working on windows since poll.c wasn't using the
same abstractions as perl; for test case, see:
    http://bugs.activestate.com/show_bug.cgi?id=19624

p4raw-id: //depot/perl@16973
p4raw-integrated: from //depot/maint-5.6/perl@16972 'merge in'
ext/IO/poll.c (@5902..) XSUB.h (@7887..)

XSUB.h
ext/IO/poll.c

diff --git a/XSUB.h b/XSUB.h
index d5c777e..2d1b8ed 100644 (file)
--- a/XSUB.h
+++ b/XSUB.h
@@ -466,6 +466,20 @@ C<xsubpp>.  See L<perlxs/"The VERSIONCHECK: Keyword">.
 #    define socket             PerlSock_socket
 #    define socketpair         PerlSock_socketpair
 #      endif   /* NETWARE && USE_STDIO */
+
+#    ifdef USE_SOCKETS_AS_HANDLES
+#      undef fd_set
+#      undef FD_SET
+#      undef FD_CLR
+#      undef FD_ISSET
+#      undef FD_ZERO
+#      define fd_set           Perl_fd_set
+#      define FD_SET(n,p)      PERL_FD_SET(n,p)
+#      define FD_CLR(n,p)      PERL_FD_CLR(n,p)
+#      define FD_ISSET(n,p)    PERL_FD_ISSET(n,p)
+#      define FD_ZERO(p)       PERL_FD_ZERO(p)
+#    endif     /* USE_SOCKETS_AS_HANDLES */
+
 #  endif  /* NO_XSLOCKS */
 #endif  /* PERL_IMPLICIT_SYS && !PERL_CORE */
 
index a09c247..a7892ff 100644 (file)
@@ -12,6 +12,8 @@
 
 #include "EXTERN.h"
 #include "perl.h"
+#include "XSUB.h"
+
 #include "poll.h"
 #ifdef I_SYS_TIME
 # include <sys/time.h>