From 97b4b0c704aef8194ab0f5d814d39452d0b3221f Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Wed, 8 Dec 2010 14:00:35 +0000 Subject: Fixed Compiling with mingw-w64 (STR #2308). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7978 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl.cxx | 14 +++++++++++++- src/Fl_win32.cxx | 9 ++------- src/fl_ask.cxx | 2 +- src/fl_dnd_win32.cxx | 2 -- 4 files changed, 16 insertions(+), 11 deletions(-) (limited to 'src') 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 #include -#include #include + +// 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 +# else +# include +# endif +#endif + +#include + #include #include #include 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 -#include #include #include #include @@ -46,13 +45,8 @@ #ifdef __CYGWIN__ # include # include -#else -# if !defined(USE_WSOCK1) -# include -#else -# include -# 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 #include +#include #if defined(__GNUC__) # include 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 #include -#else -#include #endif extern char *fl_selection_buffer[2]; -- cgit v1.2.3