diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl.cxx | 14 | ||||
| -rw-r--r-- | src/Fl_win32.cxx | 9 | ||||
| -rw-r--r-- | src/fl_ask.cxx | 2 | ||||
| -rw-r--r-- | src/fl_dnd_win32.cxx | 2 |
4 files changed, 16 insertions, 11 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index 6a4daaabe..d0042ba77 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -33,8 +33,20 @@ #include "config.h" #include <FL/Fl.H> #include <FL/Fl_Window.H> -#include <FL/x.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) +#if defined(WIN32) && !defined(__CYGWIN__) +# if !defined(USE_WSOCK1) +# include <winsock2.h> +# else +# include <winsock.h> +# endif +#endif + +#include <FL/x.H> + #include <ctype.h> #include <stdio.h> #include <stdlib.h> diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index b1bb2e3ff..f825106a9 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -31,7 +31,6 @@ #ifndef FL_DOXYGEN #include <FL/Fl.H> -#include <FL/x.H> #include <FL/fl_utf8.h> #include <FL/Fl_Window.H> #include <FL/fl_draw.H> @@ -46,13 +45,8 @@ #ifdef __CYGWIN__ # include <sys/time.h> # include <unistd.h> -#else -# if !defined(USE_WSOCK1) -# include <winsock2.h> -#else -# include <winsock.h> -# endif #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 @@ -60,6 +54,7 @@ #endif #include <winuser.h> #include <commctrl.h> +#include <FL/x.H> #if defined(__GNUC__) # include <wchar.h> diff --git a/src/fl_ask.cxx b/src/fl_ask.cxx index 7e11fb944..20e5bb5c3 100644 --- a/src/fl_ask.cxx +++ b/src/fl_ask.cxx @@ -72,7 +72,7 @@ static char avoidRecursion = 0; // pointer to one of the buttons or an Fl_Window* pointer to the // message window (message_form). static void button_cb(Fl_Widget *, void *val) { - ret_val = (int)(long)val; + ret_val = (fl_intptr_t)val; message_form->hide(); } diff --git a/src/fl_dnd_win32.cxx b/src/fl_dnd_win32.cxx index 7915d3881..4bd2d87bd 100644 --- a/src/fl_dnd_win32.cxx +++ b/src/fl_dnd_win32.cxx @@ -41,8 +41,6 @@ #if defined(__CYGWIN__) #include <sys/time.h> #include <unistd.h> -#else -#include <winsock2.h> #endif extern char *fl_selection_buffer[2]; |
