Rework the ifdefs for defining the appropriate value of WINVER in our builds.

In particular, ensure that if we redefine WINVER we undef it first (if it is already set) and also ensure that it is set before we include windows.h (by any hidden nested path!) in Fl.cxx.

Previously, we were hitting issues with WINVER being redefined in some build cases, e.g. with --enable-cairo set on a win32 build.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8722 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Ian MacArthur
2011-05-23 16:06:13 +00:00
parent fa731c806c
commit 4614fffc29
2 changed files with 77 additions and 65 deletions
+10 -4
View File
@@ -31,26 +31,32 @@
// to implement clipping. This should be changed into pure // to implement clipping. This should be changed into pure
// Quartz calls in the near future. // Quartz calls in the near future.
#include <config.h> #include <config.h>
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Tooltip.H>
/* We require Windows 2000 features (e.g. VK definitions) */ /* We require Windows 2000 features (e.g. VK definitions) */
#if defined(WIN32) #if defined(WIN32)
# if !defined(WINVER) || (WINVER < 0x0500) # if !defined(WINVER) || (WINVER < 0x0500)
# ifdef WINVER
# undef WINVER
# endif
# define WINVER 0x0500 # define WINVER 0x0500
# endif # endif
# if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500) # if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)
# ifdef _WIN32_WINNT
# undef _WIN32_WINNT
# endif
# define _WIN32_WINNT 0x0500 # define _WIN32_WINNT 0x0500
# endif # endif
#endif #endif
// recent versions of MinGW warn: "Please include winsock2.h before windows.h", // 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) // hence we must include winsock2.h before FL/Fl.H (A.S. Dec. 2010, IMM May 2011)
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(WIN32) && !defined(__CYGWIN__)
# include <winsock2.h> # include <winsock2.h>
#endif #endif
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Tooltip.H>
#include <FL/x.H> #include <FL/x.H>
#include <ctype.h> #include <ctype.h>
+6
View File
@@ -31,9 +31,15 @@
# endif # endif
/* We require Windows 2000 features such as GetGlyphIndices */ /* We require Windows 2000 features such as GetGlyphIndices */
# if !defined(WINVER) || (WINVER < 0x0500) # if !defined(WINVER) || (WINVER < 0x0500)
# ifdef WINVER
# undef WINVER
# endif
# define WINVER 0x0500 # define WINVER 0x0500
# endif # endif
# if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500) # if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)
# ifdef _WIN32_WINNT
# undef _WIN32_WINNT
# endif
# define _WIN32_WINNT 0x0500 # define _WIN32_WINNT 0x0500
# endif # endif
#endif #endif