summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES7
-rw-r--r--src/Fl.cxx8
-rw-r--r--src/Fl_win32.cxx25
3 files changed, 19 insertions, 21 deletions
diff --git a/CHANGES b/CHANGES
index b31760628..5adfe69f4 100644
--- a/CHANGES
+++ b/CHANGES
@@ -188,9 +188,10 @@ CHANGES IN FLTK 1.3.0
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
diff --git a/src/Fl.cxx b/src/Fl.cxx
index d0042ba77..69e0a215a 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -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>
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index f825106a9..539e271ee 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -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 @@ FL_EXPORT Fl_Surface_Device *fl_surface = (Fl_Surface_Device*)fl_display_device;
#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) {