[svn:parrot] r47583 - in trunk: examples/io src/io
coke at svn.parrot.org
coke at svn.parrot.org
Sun Jun 13 01:02:27 UTC 2010
Author: coke
Date: Sun Jun 13 01:02:26 2010
New Revision: 47583
URL: https://trac.parrot.org/parrot/changeset/47583
Log:
remove PARROT_NET_DEVEL-
Resolve TT #534
Modified:
trunk/examples/io/http.pir
trunk/examples/io/httpd.pir
trunk/src/io/io_private.h
trunk/src/io/socket_unix.c
trunk/src/io/socket_win32.c
trunk/src/io/win32.c
Modified: trunk/examples/io/http.pir
==============================================================================
--- trunk/examples/io/http.pir Sun Jun 13 00:59:01 2010 (r47582)
+++ trunk/examples/io/http.pir Sun Jun 13 01:02:26 2010 (r47583)
@@ -13,9 +13,7 @@
HTTP client, connects to WWW port and grabs a page (L<http://www.ibm.com>).
-You should be running the echo service on your box (port 7). Be sure to
-set C<PARROT_NET_DEVEL> to 1 in F<io/io_private.h> and rebuld Parrot or
-the network layer won't exist.
+You should be running the echo service on your box (port 7).
=cut
Modified: trunk/examples/io/httpd.pir
==============================================================================
--- trunk/examples/io/httpd.pir Sun Jun 13 00:59:01 2010 (r47582)
+++ trunk/examples/io/httpd.pir Sun Jun 13 01:02:26 2010 (r47583)
@@ -270,7 +270,6 @@
ERR_NO_SOCKET:
print "Could not open socket.\n"
- print "Did you enable PARROT_NET_DEVEL in include/io_private.h?\n"
end
ERR_bind:
print "bind failed\n"
Modified: trunk/src/io/io_private.h
==============================================================================
--- trunk/src/io/io_private.h Sun Jun 13 00:59:01 2010 (r47582)
+++ trunk/src/io/io_private.h Sun Jun 13 01:02:26 2010 (r47583)
@@ -27,23 +27,19 @@
#define PARROT_IN_IO 1
#define PARROT_ASYNC_DEVEL 0
-#define PARROT_NET_DEVEL 1
#include <parrot/io.h>
-#if PARROT_NET_DEVEL
/* XXX: Parrot config is currently not probing for all headers so
* I'm sticking here rather than parrot.h
*/
-# ifdef UNIX
-# include <sys/socket.h>
-# endif
-
-# ifdef WIN32
-# include <winsock.h>
-# endif
+#ifdef UNIX
+# include <sys/socket.h>
+#endif
-#endif /* PARROT_NET_DEVEL */
+#ifdef WIN32
+# include <winsock.h>
+#endif
/* IO object flags */
#define PIO_F_READ 00000001
Modified: trunk/src/io/socket_unix.c
==============================================================================
--- trunk/src/io/socket_unix.c Sun Jun 13 00:59:01 2010 (r47582)
+++ trunk/src/io/socket_unix.c Sun Jun 13 01:02:26 2010 (r47583)
@@ -67,8 +67,6 @@
=head2 Networking
-Define C<PARROT_NET_DEVEL> to enable networking.
-
These could be native extensions but they probably should be here if we
wish to make them integrated with the async IO system.
@@ -110,8 +108,6 @@
}
-# if PARROT_NET_DEVEL
-
/*
=item C<INTVAL Parrot_io_socket_unix(PARROT_INTERP, PMC *s, int fam, int type,
@@ -314,13 +310,13 @@
switch (errno) {
case EINTR:
goto AGAIN;
-# ifdef EWOULDBLOCK
+# ifdef EWOULDBLOCK
case EWOULDBLOCK:
goto AGAIN;
-# else
+# else
case EAGAIN:
goto AGAIN;
-# endif
+# endif
case EPIPE:
/* XXX why close it here and not below */
close(io->os_handle);
@@ -363,13 +359,13 @@
switch (errno) {
case EINTR:
goto AGAIN;
-# ifdef EWOULDBLOCK
+# ifdef EWOULDBLOCK
case EWOULDBLOCK:
goto AGAIN;
-# else
+# else
case EAGAIN:
goto AGAIN;
-# endif
+# endif
case ECONNRESET:
/* XXX why close it on err return result is -1 anyway */
close(io->os_handle);
@@ -457,12 +453,12 @@
const int family = AF_INET;
struct sockaddr_in * const sa = (struct sockaddr_in*)VTABLE_get_pointer(interp, sockaddr);
-# ifdef PARROT_DEF_INET_ATON
+# ifdef PARROT_DEF_INET_ATON
if (inet_aton(host, &sa->sin_addr) != 0) {
-# else
+# else
/* positive retval is success */
if (inet_pton(family, host, &sa->sin_addr) > 0) {
-# endif
+# endif
/* Success converting numeric IP */
}
else {
@@ -482,7 +478,6 @@
sa->sin_family = family;
sa->sin_port = htons(port);
}
-# endif
#endif /* PIO_OS_UNIX */
Modified: trunk/src/io/socket_win32.c
==============================================================================
--- trunk/src/io/socket_win32.c Sun Jun 13 00:59:01 2010 (r47582)
+++ trunk/src/io/socket_win32.c Sun Jun 13 01:02:26 2010 (r47583)
@@ -51,13 +51,11 @@
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: static */
-# if PARROT_NET_DEVEL
-
/* Helper macros to get sockaddr_in */
-# define SOCKADDR_LOCAL(p) ((struct sockaddr_in*)VTABLE_get_pointer(interp, \
- PARROT_SOCKET((p))->local))
-# define SOCKADDR_REMOTE(p) ((struct sockaddr_in*)VTABLE_get_pointer(interp, \
- PARROT_SOCKET((p))->remote))
+# define SOCKADDR_LOCAL(p) ((struct sockaddr_in*)VTABLE_get_pointer(interp, \
+ PARROT_SOCKET((p))->local))
+# define SOCKADDR_REMOTE(p) ((struct sockaddr_in*)VTABLE_get_pointer(interp, \
+ PARROT_SOCKET((p))->remote))
/*
@@ -262,13 +260,13 @@
switch (errno) {
case WSAEINTR:
goto AGAIN;
-# ifdef WSAEWOULDBLOCK
+# ifdef WSAEWOULDBLOCK
case WSAEWOULDBLOCK:
goto AGAIN;
-# else
+# else
case WSAEAGAIN:
goto AGAIN;
-# endif
+# endif
case EPIPE:
/* XXX why close it here and not below */
close((int)io->os_handle);
@@ -311,13 +309,13 @@
switch (errno) {
case EINTR:
goto AGAIN;
-# ifdef WSAEWOULDBLOCK
+# ifdef WSAEWOULDBLOCK
case WSAEWOULDBLOCK:
goto AGAIN;
-# else
+# else
case WSAEAGAIN:
goto AGAIN;
-# endif
+# endif
case WSAECONNRESET:
/* XXX why close it on err return result is -1 anyway */
close((int)io->os_handle);
@@ -452,8 +450,6 @@
return sockaddr;
}
-# endif /* PARROT_NET_DEVEL */
-
#endif /* PIO_OS_WIN32 */
/*
Modified: trunk/src/io/win32.c
==============================================================================
--- trunk/src/io/win32.c Sun Jun 13 00:59:01 2010 (r47582)
+++ trunk/src/io/win32.c Sun Jun 13 01:02:26 2010 (r47583)
@@ -134,10 +134,8 @@
{
ASSERT_ARGS(Parrot_io_init_win32)
HANDLE h;
-# if PARROT_NET_DEVEL
struct WSAData sockinfo;
int ret;
-# endif
if ((h = GetStdHandle(STD_INPUT_HANDLE)) != INVALID_HANDLE_VALUE) {
_PIO_STDIN(interp) = Parrot_io_fdopen_win32(interp, PMCNULL, h, PIO_F_READ);
@@ -157,7 +155,6 @@
else {
_PIO_STDERR(interp) = PMCNULL;
}
-# if PARROT_NET_DEVEL
/* Start Winsock
* no idea where or whether destroy it
*/
@@ -167,7 +164,6 @@
WSAGetLastError());
return -4;
}
-# endif
return 0;
}
More information about the parrot-commits
mailing list