This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libgcj/16814] [win32] libgcj dpends on both winsock32dll and ws2_32.dll


------- Additional Comments From dannysmith at users dot sourceforge dot net  2004-07-31 02:17 -------
Comment 6 appears to be directed to Ranjit, so I haven't done anything yet.

Here is the patch that I have tested on native mingw32 build

2004-07-31  Danny Smith  <dannysmith@users.sourceforge.net>

	PR gcj/16814
	* configure.in [host *mingw*] (SYSTEMSPEC): Remove -lwsock32.
	* configure. Regenerate.
	* include/win32.h: Explicitly include winsock2.h
	* win32.cc (_Jv_platform_initialize): Require version 2.2 of
	Winsock api.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libjava/configure.in,v
retrieving revision 1.196
diff -c -3 -p -r1.196 configure.in
*** configure.in	23 Jul 2004 23:34:16 -0000	1.196
--- configure.in	31 Jul 2004 01:08:09 -0000
*************** AC_LINK_FILES(gnu/java/nio/channels/natF
*** 481,487 ****
  
  case "${host}" in
      *mingw*)
!       SYSTEMSPEC="-lgdi32 -lwsock32 -lws2_32"
        if test "${with_win32_nlsapi}" = "unicows"; then
          SYSTEMSPEC="-lunicows $SYSTEMSPEC"
        fi
--- 481,487 ----
  
  case "${host}" in
      *mingw*)
!       SYSTEMSPEC="-lgdi32 -lws2_32"
        if test "${with_win32_nlsapi}" = "unicows"; then
          SYSTEMSPEC="-lunicows $SYSTEMSPEC"
        fi
Index: win32.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/win32.cc,v
retrieving revision 1.21
diff -c -3 -p -r1.21 win32.cc
*** win32.cc	16 Dec 2003 22:54:21 -0000	1.21
--- win32.cc	31 Jul 2004 01:08:11 -0000
*************** _Jv_platform_initialize (void)
*** 256,262 ****
  {
    // Initialise winsock for networking
    WSADATA data;
!   if (WSAStartup (MAKEWORD (1, 1), &data))
      MessageBox (NULL, _T("Error initialising winsock library."), _T("Error"),
      MB_OK | MB_ICONEXCLAMATION);
  
--- 256,262 ----
  {
    // Initialise winsock for networking
    WSADATA data;
!   if (WSAStartup (MAKEWORD (2, 2), &data))
      MessageBox (NULL, _T("Error initialising winsock library."), _T("Error"),
      MB_OK | MB_ICONEXCLAMATION);
  
Index: include/win32.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/win32.h,v
retrieving revision 1.26
diff -c -3 -p -r1.26 win32.h
*** include/win32.h	16 Dec 2003 22:54:22 -0000	1.26
--- include/win32.h	31 Jul 2004 01:09:03 -0000
*************** details.  */
*** 22,27 ****
--- 22,29 ----
  
  // Includes
  #define WIN32_LEAN_AND_MEAN
+ // Force Winsock 2 interface.
+ #include <winsock2.h>
  #include <windows.h>
  #undef WIN32_LEAN_AND_MEAN
  #undef STRICT

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16814


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]