From 101e950299ee444907fda7da379eec97a85c715f Mon Sep 17 00:00:00 2001 From: mkoch Date: Thu, 21 Nov 2002 10:24:18 +0000 Subject: Forgot to add to cvs command line git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59340 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/java/net/natPlainSocketImpl.cc | 59 ++++------------------------------ 1 file changed, 7 insertions(+), 52 deletions(-) (limited to 'libjava/java/net/natPlainSocketImpl.cc') diff --git a/libjava/java/net/natPlainSocketImpl.cc b/libjava/java/net/natPlainSocketImpl.cc index 275e8f9a4c8..9cd0f3b9dff 100644 --- a/libjava/java/net/natPlainSocketImpl.cc +++ b/libjava/java/net/natPlainSocketImpl.cc @@ -10,7 +10,9 @@ details. */ #include #ifndef DISABLE_JAVA_NET + #ifdef WIN32 + #include #include #include @@ -20,8 +22,6 @@ details. */ #undef MIN_PRIORITY #undef FIONREAD -#define NATIVE_CLOSE(s) closesocket (s) - // These functions make the Win32 socket API look more POSIXy static inline int write(int s, void *buf, int len) @@ -36,11 +36,6 @@ read(int s, void *buf, int len) } // these errors cannot occur on Win32 -#define ENOTCONN 0 -#define ECONNRESET 0 -#ifndef ENOPROTOOPT -#define ENOPROTOOPT 109 -#endif #else /* WIN32 */ #ifdef HAVE_SYS_IOCTL_H @@ -53,14 +48,11 @@ read(int s, void *buf, int len) #include #endif -#include #include #include #include #include -#define NATIVE_CLOSE(s) ::close (s) - #endif /* WIN32 */ #endif /* DISABLE_JAVA_NET */ @@ -73,43 +65,6 @@ read(int s, void *buf, int len) typedef int socklen_t; #endif -#ifndef DISABLE_JAVA_NET - -// Avoid macro definitions of bind, connect from system headers, e.g. on -// Solaris 7 with _XOPEN_SOURCE. FIXME -static inline int -_Jv_bind (int fd, struct sockaddr *addr, int addrlen) -{ - return ::bind (fd, addr, addrlen); -} - -#ifdef bind -#undef bind -#endif - -static inline int -_Jv_connect (int fd, struct sockaddr *addr, int addrlen) -{ - return ::connect (fd, addr, addrlen); -} - -#ifdef connect -#undef connect -#endif - -// Same problem with accept on Tru64 UNIX with _POSIX_PII_SOCKET -static inline int -_Jv_accept (int fd, struct sockaddr *addr, socklen_t *addrlen) -{ - return ::accept (fd, addr, addrlen); -} - -#ifdef accept -#undef accept -#endif - -#endif /* DISABLE_JAVA_NET */ - #include #include #include @@ -258,7 +213,7 @@ union SockAddr void java::net::PlainSocketImpl::create (jboolean stream) { - int sock = ::socket (AF_INET, stream ? SOCK_STREAM : SOCK_DGRAM, 0); + int sock = _Jv_socket (AF_INET, stream ? SOCK_STREAM : SOCK_DGRAM, 0); if (sock < 0) { @@ -495,7 +450,7 @@ java::net::PlainSocketImpl::close() JvSynchronize sync (this); // should we use shutdown here? how would that effect so_linger? - int res = NATIVE_CLOSE (fnum); + int res = _Jv_close (fnum); if (res == -1) { @@ -518,7 +473,7 @@ java::net::PlainSocketImpl::write(jint b) while (r != 1) { - r = ::write (fnum, &d, 1); + r = _Jv_write (fnum, &d, 1); if (r == -1) { if (java::lang::Thread::interrupted()) @@ -551,7 +506,7 @@ java::net::PlainSocketImpl::write(jbyteArray b, jint offset, jint len) while (len > 0) { - int r = ::write (fnum, bytes, len); + int r = _Jv_write (fnum, bytes, len); if (r == -1) { @@ -614,7 +569,7 @@ java::net::PlainSocketImpl::read(void) } #endif /* WIN32 */ - int r = ::read (fnum, &b, 1); + int r = _Jv_read (fnum, &b, 1); if (r == 0) return -1; -- cgit v1.2.3