patch to enable inet_addr() on Win32

Adam Megacz gcj@lists.megacz.com
Sun May 26 18:22:00 GMT 2002


[CC Mark for branch approval]
What this does:
 Because of Win32's bizarre header regime, configure can not
 correctly detect inet_addr() on mingw. This patch explicitly enables
 HAVE_INET_ADDR on Win32 builds of libgcj.
Why this is important:
 Performance: without this patch, creating an InetAddress object out
 of a dotted-decimal incurs a DNS lookup.
 Correctness: With some oddball resolver implementations (for
 example, some of the "personal firewalls" for Windows), this may
 fail since the resolver doesn't expect a dotted-decimal -- it
 expects a hostname.
> a) they appear safe
> c) they add support for new platforms, language features, etc.
> that we did not support before -- and that we cannot, therefore,
> be regressing.

Mark, I'd like to petition for approval based on (a) and (c). The
patch is pretty trivial/noninvasive, and Win32 is still missing a lot
of functionality, so we know that nobody's really depending on it to
work for anything important (yet).
 - a
2002年05月26日 Adam Megacz <adam@xwt.org>
 * include/win32.h: Defined HAVE_INET_ADDR.
 * java/net/natInetAddress.cc: Included platform.h.
Index: include/win32.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/win32.h,v
retrieving revision 1.3.8.5
diff -u -r1.3.8.5 win32.h
--- include/win32.h 24 Apr 2002 01:04:45 -0000 1.3.8.5
+++ include/win32.h 27 May 2002 01:14:09 -0000
@@ -35,4 +35,6 @@
 ARRAY and return the exact number of values stored. */
 extern int backtrace (void **__array, int __size);
 
+#define HAVE_INET_ADDR
+
 #endif /* __JV_WIN32_H__ */
Index: java/net/natInetAddress.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/natInetAddress.cc,v
retrieving revision 1.18.18.1
diff -u -r1.18.18.1 natInetAddress.cc
--- java/net/natInetAddress.cc 4 Mar 2002 20:02:19 -0000 1.18.18.1
+++ java/net/natInetAddress.cc 27 May 2002 01:14:09 -0000
@@ -9,6 +9,7 @@
 details. */
 
 #include <config.h>
+#include <platform.h>
 
 #ifdef WIN32


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /