Patch: win32.h Cleanup w.r.t. w32api 2.x
Ranjit Mathew
rmathew@hotmail.com
Wed Jan 15 06:10:00 GMT 2003
Hi,
This patch proposes to slightly clean up the win32.h
header file w.r.t. to the w32api 2.x packages for Cygwin/MinGW.
Note that after this change, only w32api 2.x can be used
to compile GCJ for MinGW, but without it, it doesn't compile
at all with w32api-2.x.
The rationale for the changes are:
1. Only ws2tcpip.h defines "socklen_t" without which the
networking code doesn't compile.
2. ws2tcpip.h defins IP_TOS to be 3 (WinSock 2) so the
explicit definition is not needed.
3. Slight formatting error in _Jv_connect( ).
Even after these, I still have some questions on this
header which perhaps Adam is best equipped to answer:
a. What is the need for "#undef STRICT" at the begining?
Is this to overcome some limitation of earlier w32api
headers?
b. Why does it say that ECONNRESET and ENOTCONN cannot
occur on Win32? Why then are the error codes
WSAECONNRESET and WSAENOTCONN defined by WinSock 2?
c. It defines ENOPROTOOPT to 109 - however, WSAENOPROTOOPT
is defined to be 10042 and is really what is
returned by WinSock 2.
Thanks in advance for clarifying these issues.
ChangeLog:
2003-01-15 Ranjit Mathew <rmathew@hotmail.com>
* include/win32.h: Include ws2tcpip.h instead of
winsock.h to obtain definition of the socklen_t type.
Remove IP_TOS definition - not needed with ws2tcpip.h
(_Jv_connect): Correct slight formatting error.
Patch:
---------------------------------- 8< ----------------------------------
--- win32.h Wed Jan 15 11:19:35 2003
+++ win32.h Wed Jan 15 11:21:53 2003
@@ -1,5 +1,5 @@
// win32.h -- Helper functions for Microsoft-flavored OSs.
-/* Copyright (C) 2002 Free Software Foundation
+/* Copyright (C) 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -15,7 +15,5 @@
#undef STRICT
-#undef __INSIDE_CYGWIN__
-#include <winsock.h>
-#define IP_TOS 3
+#include <ws2tcpip.h>
#include <gcj/cni.h>
#include <java/util/Properties.h>
@@ -75,5 +73,5 @@
_Jv_connect (jint fd, sockaddr *ptr, int len)
{
- return ::connect (fd, ptr, len);
+ return ::connect (fd, ptr, len);
}
---------------------------------- 8< ----------------------------------
Sincerely Yours,
Ranjit.
--
Ranjit Mathew Email: rmathew AT hotmail DOT com
Bangalore, INDIA. Web: http://ranjitmathew.tripod.com/
More information about the Java-patches
mailing list