Compile errors in libgcj while building cross-compiler for MinGW

Ranjit Mathew rmathew@hotmail.com
Wed Dec 18 11:37:00 GMT 2002


Hi,

     I am trying to create a GCJ 3.3 cross-compiler targetting MinGW
on Linux from the latest snapshots and am running into some issues
with some networking code in libgcj. FYI, I'm using mingw-runtime-2.2
and w32api-2.0. I'm posting this to find out how Adam and the
other MinGW hackers, if any, have got around these issues and are
able to build a cross-compiler.

First off, socklen_t is used by libgcj and it is defined only
in ws2tcpip.h - if I don't make the following change, things
just don't work:
------------------------------------ 8< -------------------------------------
--- libjava/include/win32.h	2002-12-18 23:28:14.000000000 +0530
+++ libjava/include/win32.h	2002-12-18 23:31:33.000000000 +0530
@@ -15,6 +15,5 @@
  #undef STRICT

-#undef __INSIDE_CYGWIN__
-#include <winsock.h>
+#include <ws2tcpip.h>
  #define IP_TOS 3
  #include <gcj/cni.h>
------------------------------------ 8< -------------------------------------

Second, java/net/natPlainDatagramSockImpl.cc uses the ECONNREFUSED
errno code to check for refused connection. However, on Windows, not only is
this not defined, according to WinSock2 APIs the last error code can be
retrieved using WSAGetLastError( ) and not checking for errno - then again
it is WSAECONNREFUSED and not ECONNREFUSED.

Am I missing something here? If yes, please tell me what it is. If not, I
guess I should try to submit a patch for rectifying this.

Thanks for your help in advance.

Sincerely Yours,
Ranjit.

-- 
Ranjit Mathew        Email: rmathew AT hotmail DOT com
Bangalore,
INDIA.               Web: http://ranjitmathew.tripod.com/





More information about the Java mailing list