aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorTony Kimball <alk@pobox.com>2002-08-27 16:08:31 +0000
committerTom Tromey <tromey@gcc.gnu.org>2002-08-27 16:08:31 +0000
commit835cb22e3bb779908a8d418137d1ff35bc432c2c (patch)
tree48fd4eeb11e4db9380644fa21c9dd75585c317b8 /libjava
parent8632ed40b6999d80593096177abe87deee06c165 (diff)
downloadgcc-835cb22e3bb779908a8d418137d1ff35bc432c2c.zip
gcc-835cb22e3bb779908a8d418137d1ff35bc432c2c.tar.gz
gcc-835cb22e3bb779908a8d418137d1ff35bc432c2c.tar.bz2
natPlainDatagramSocketImpl.cc (NATIVE_CLOSE): New define.
2002-08-27 Tony Kimball <alk@pobox.com> Tom Tromey <tromey@redhat.com> * java/net/natPlainDatagramSocketImpl.cc (NATIVE_CLOSE): New define. (::close): Removed. (PlainDatagramSocketImpl::close): Use NATIVE_CLOSE. * java/net/natPlainSocketImpl.cc (NATIVE_CLOSE): New define. (::close): Removed. (PlainSocketImpl::close): Use NATIVE_CLOSE. * include/win32.h (getcwd): Removed declaration. Include io.h. Co-Authored-By: Tom Tromey <tromey@redhat.com> From-SVN: r56605
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog12
-rw-r--r--libjava/include/win32.h3
-rw-r--r--libjava/java/net/natPlainDatagramSocketImpl.cc12
-rw-r--r--libjava/java/net/natPlainSocketImpl.cc12
4 files changed, 24 insertions, 15 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 2237d43..5724512 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,15 @@
+2002-08-27 Tony Kimball <alk@pobox.com>
+ Tom Tromey <tromey@redhat.com>
+
+ * java/net/natPlainDatagramSocketImpl.cc (NATIVE_CLOSE): New
+ define.
+ (::close): Removed.
+ (PlainDatagramSocketImpl::close): Use NATIVE_CLOSE.
+ * java/net/natPlainSocketImpl.cc (NATIVE_CLOSE): New define.
+ (::close): Removed.
+ (PlainSocketImpl::close): Use NATIVE_CLOSE.
+ * include/win32.h (getcwd): Removed declaration. Include io.h.
+
2002-08-25 Adam Megacz <adam@xwt.org>
* include/win32.h (getcwd): copied function declaration as
diff --git a/libjava/include/win32.h b/libjava/include/win32.h
index 9e494ad..da71b8b 100644
--- a/libjava/include/win32.h
+++ b/libjava/include/win32.h
@@ -19,8 +19,7 @@ details. */
#include <gcj/cni.h>
#include <java/util/Properties.h>
-// FIXME: remove this once the io.h issue is resolved
-extern "C" char* getcwd (char*, int);
+#include <io.h>
extern void _Jv_platform_initialize (void);
extern void _Jv_platform_initProperties (java::util::Properties*);
diff --git a/libjava/java/net/natPlainDatagramSocketImpl.cc b/libjava/java/net/natPlainDatagramSocketImpl.cc
index 2375bdb..e581f08 100644
--- a/libjava/java/net/natPlainDatagramSocketImpl.cc
+++ b/libjava/java/net/natPlainDatagramSocketImpl.cc
@@ -17,13 +17,10 @@ details. */
#define ENOPROTOOPT 109
#endif
-static inline int
-close(int s)
-{
- return closesocket(s);
-}
+#define NATIVE_CLOSE(s) closesocket (s)
#else /* WIN32 */
+
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
@@ -35,6 +32,9 @@ close(int s)
#endif
#include <errno.h>
#include <string.h>
+
+#define NATIVE_CLOSE(s) ::close (s)
+
#endif /* WIN32 */
#if HAVE_BSTRING_H
@@ -303,7 +303,7 @@ java::net::PlainDatagramSocketImpl::close ()
// The method isn't declared to throw anything, so we disregard
// the return value.
- ::close (fnum);
+ NATIVE_CLOSE (fnum);
fnum = -1;
timeout = 0;
}
diff --git a/libjava/java/net/natPlainSocketImpl.cc b/libjava/java/net/natPlainSocketImpl.cc
index 4a75e98..370c994 100644
--- a/libjava/java/net/natPlainSocketImpl.cc
+++ b/libjava/java/net/natPlainSocketImpl.cc
@@ -20,13 +20,9 @@ details. */
#undef MIN_PRIORITY
#undef FIONREAD
-// These functions make the Win32 socket API look more POSIXy
-static inline int
-close(int s)
-{
- return closesocket(s);
-}
+#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)
{
@@ -63,6 +59,8 @@ read(int s, void *buf, int len)
#include <errno.h>
#include <string.h>
+#define NATIVE_CLOSE(s) ::close (s)
+
#endif /* WIN32 */
#endif /* DISABLE_JAVA_NET */
@@ -429,7 +427,7 @@ java::net::PlainSocketImpl::close()
JvSynchronize sync (this);
// should we use shutdown here? how would that effect so_linger?
- int res = ::close (fnum);
+ int res = NATIVE_CLOSE (fnum);
if (res == -1)
{