Author: AlbrechtS
Date: 2010-12-09 01:03:17 -0800 (Thu, 09 Dec 2010)
New Revision: 7987
Log:
Windows: removed hidden old winsock 1 (wsock32.dll) support, as
discussed in fltk.development. We exclusively use winsock 2
(ws2_32.dll) and winsock2.h now.


Modified:
   branches/branch-1.3/CHANGES
   branches/branch-1.3/src/Fl.cxx
   branches/branch-1.3/src/Fl_win32.cxx

Modified: branches/branch-1.3/CHANGES
===================================================================
--- branches/branch-1.3/CHANGES 2010-12-09 01:03:59 UTC (rev 7986)
+++ branches/branch-1.3/CHANGES 2010-12-09 09:03:17 UTC (rev 7987)
@@ -188,9 +188,10 @@
          Fl_Value_Input, and Fl_Text_Display derived
           widgets (STR #1770)
         - Initial setup (STR #1904)
-       - winsock dll is dynamically loaded and by default 
-         ws2_32.dll, use of winsock1 is still possible by defining 
-         USE_WSOCK1 at compile time.
+       - FLTK now uses winsock2 (ws2_32.dll) instead of wsock32.dll
+         for Windows. The dll is loaded dynamically only if/when
+         needed; there is no need to link with winsock (ws2_32.lib)
+         if your program doesn't need socket operations.
        - Cairo support: added --enable-cairo and --enable-cairoext 
           configure options.
        - visualc(6) & vc2005 devenv's are in the ide subdirectory

Modified: branches/branch-1.3/src/Fl.cxx
===================================================================
--- branches/branch-1.3/src/Fl.cxx      2010-12-09 01:03:59 UTC (rev 7986)
+++ branches/branch-1.3/src/Fl.cxx      2010-12-09 09:03:17 UTC (rev 7987)
@@ -35,14 +35,10 @@
 #include <FL/Fl_Window.H>
 #include <FL/Fl_Tooltip.H>
 
-// recent versions of MinGW warn us "Please include winsock2.h before 
windows.h"
-// hence we must include winsock*.h before FL/x.H (A.S. Dec. 2010)
+// recent versions of MinGW warn: "Please include winsock2.h before windows.h",
+// hence we must include winsock2.h before FL/x.H (A.S. Dec. 2010)
 #if defined(WIN32) && !defined(__CYGWIN__)
-# if !defined(USE_WSOCK1)
 #  include <winsock2.h>
-# else
-#  include <winsock.h>
-# endif
 #endif
 
 #include <FL/x.H>

Modified: branches/branch-1.3/src/Fl_win32.cxx
===================================================================
--- branches/branch-1.3/src/Fl_win32.cxx        2010-12-09 01:03:59 UTC (rev 
7986)
+++ branches/branch-1.3/src/Fl_win32.cxx        2010-12-09 09:03:17 UTC (rev 
7987)
@@ -29,6 +29,8 @@
 // in.  Search other files for "WIN32" or filenames ending in _win32.cxx
 // for other system-specific code.
 
+// This file must be #include'd in Fl.cxx and not compiled separately.
+
 #ifndef FL_DOXYGEN
 #include <FL/Fl.H>
 #include <FL/fl_utf8.h>
@@ -46,22 +48,17 @@
 #  include <sys/time.h>
 #  include <unistd.h>
 #endif
-// note: the corresponding winsock*.h has been #include'd in Fl.cxx
-#if !defined(USE_WSOCK1)
-#  define WSCK_DLL_NAME "WS2_32.DLL"
-#else
-#  define WSCK_DLL_NAME "WSOCK32.DLL"
+
+#if !defined(NO_TRACK_MOUSE)
+#include <commctrl.h>  // TrackMouseEvent
 #endif
-#include <winuser.h>
-#include <commctrl.h>
-#include <FL/x.H>
 
 #if defined(__GNUC__)
 # include <wchar.h>
 #endif
 
-#  include <ole2.h>
-#  include <shellapi.h>
+#include <ole2.h>
+#include <shellapi.h>
 
 #include "aimm.h"
 
@@ -97,12 +94,16 @@
 #if defined(__CYGWIN__) && !defined(SOCKET)
 # define SOCKET int
 #endif
+
+// note: winsock2.h has been #include'd in Fl.cxx
+#define WSCK_DLL_NAME "WS2_32.DLL"
+
 typedef int (WINAPI* fl_wsk_select_f)(int, fd_set*, fd_set*, fd_set*, const 
struct timeval*);
 typedef int (WINAPI* fl_wsk_fd_is_set_f)(SOCKET, fd_set *);
 
 static HMODULE s_wsock_mod = 0;
-static fl_wsk_select_f s_wsock_select=0;
-static fl_wsk_fd_is_set_f fl_wsk_fd_is_set=0;
+static fl_wsk_select_f s_wsock_select = 0;
+static fl_wsk_fd_is_set_f fl_wsk_fd_is_set = 0;
 
 static HMODULE get_wsock_mod() {
   if (!s_wsock_mod) {

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to