From 961f4d0ce6fb0478c2850d2da37e072d8636639a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 3 Apr 2010 12:25:52 +0000 Subject: [PATCH 1/1] Correct compilation breakage of r63832. wx/setup.h can't use wxCHECK_VISUALC_VERSION() which is defined in wx/platform.h _after_ wx/setup.h inclusion. Replace wxCHECK_VISUALC_VERSION() with manual tests for _MSC_VER. Also add more comments to explain what's going on. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63842 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/motif/setup0.h | 24 ++++++++++++++++++++---- include/wx/msw/setup0.h | 24 ++++++++++++++++++++---- include/wx/msw/wince/setup.h | 24 ++++++++++++++++++++---- include/wx/os2/setup0.h | 24 ++++++++++++++++++++---- include/wx/osx/setup0.h | 24 ++++++++++++++++++++---- include/wx/palmos/setup0.h | 24 ++++++++++++++++++++---- include/wx/setup_inc.h | 24 ++++++++++++++++++++---- include/wx/univ/setup0.h | 24 ++++++++++++++++++++---- setup.h.in | 20 +++++++++++++++++--- 9 files changed, 177 insertions(+), 35 deletions(-) diff --git a/include/wx/motif/setup0.h b/include/wx/motif/setup0.h index 2d21d12393..00db8cc364 100644 --- a/include/wx/motif/setup0.h +++ b/include/wx/motif/setup0.h @@ -666,11 +666,27 @@ // mingw32) you may need to install the headers (and just the headers) // yourself. If you do, change the setting below manually. // -// Recommended setting: 1 -#if !defined(__WXMSW__) || wxCHECK_VISUALC_VERSION(7) - #define wxUSE_GRAPHICS_CONTEXT 1 +// Recommended setting: 1 if supported by the compilation environment + +// notice that we can't use wxCHECK_VISUALC_VERSION() here as this file is +// included from wx/platform.h before wxCHECK_VISUALC_VERSION() is defined +#ifdef _MSC_VER +# if _MSC_VER >= 1400 + // MSVC7+ comes with new enough Platform SDK, enable wxGraphicsContext + // support for it +# define wxUSE_GRAPHICS_CONTEXT 1 +# else + // MSVC 6 didn't include GDI+ headers so disable by default, enable it + // here if you use MSVC 6 with a newer SDK +# define wxUSE_GRAPHICS_CONTEXT 0 +# endif #else - #define wxUSE_GRAPHICS_CONTEXT 0 + // Disable support for other Windows compilers, enable it if your compiler + // comes with new enough SDK or you installed the headers manually. + // + // Notice that this will be set by configure under non-Windows platforms + // anyhow so the value there is not important. +# define wxUSE_GRAPHICS_CONTEXT 0 #endif // ---------------------------------------------------------------------------- diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index e28a11d271..326ca90733 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -666,11 +666,27 @@ // mingw32) you may need to install the headers (and just the headers) // yourself. If you do, change the setting below manually. // -// Recommended setting: 1 -#if !defined(__WXMSW__) || wxCHECK_VISUALC_VERSION(7) - #define wxUSE_GRAPHICS_CONTEXT 1 +// Recommended setting: 1 if supported by the compilation environment + +// notice that we can't use wxCHECK_VISUALC_VERSION() here as this file is +// included from wx/platform.h before wxCHECK_VISUALC_VERSION() is defined +#ifdef _MSC_VER +# if _MSC_VER >= 1400 + // MSVC7+ comes with new enough Platform SDK, enable wxGraphicsContext + // support for it +# define wxUSE_GRAPHICS_CONTEXT 1 +# else + // MSVC 6 didn't include GDI+ headers so disable by default, enable it + // here if you use MSVC 6 with a newer SDK +# define wxUSE_GRAPHICS_CONTEXT 0 +# endif #else - #define wxUSE_GRAPHICS_CONTEXT 0 + // Disable support for other Windows compilers, enable it if your compiler + // comes with new enough SDK or you installed the headers manually. + // + // Notice that this will be set by configure under non-Windows platforms + // anyhow so the value there is not important. +# define wxUSE_GRAPHICS_CONTEXT 0 #endif // ---------------------------------------------------------------------------- diff --git a/include/wx/msw/wince/setup.h b/include/wx/msw/wince/setup.h index b63ddda90c..94e1cc63eb 100644 --- a/include/wx/msw/wince/setup.h +++ b/include/wx/msw/wince/setup.h @@ -666,11 +666,27 @@ // mingw32) you may need to install the headers (and just the headers) // yourself. If you do, change the setting below manually. // -// Recommended setting: 1 -#if !defined(__WXMSW__) || wxCHECK_VISUALC_VERSION(7) - #define wxUSE_GRAPHICS_CONTEXT 1 +// Recommended setting: 1 if supported by the compilation environment + +// notice that we can't use wxCHECK_VISUALC_VERSION() here as this file is +// included from wx/platform.h before wxCHECK_VISUALC_VERSION() is defined +#ifdef _MSC_VER +# if _MSC_VER >= 1400 + // MSVC7+ comes with new enough Platform SDK, enable wxGraphicsContext + // support for it +# define wxUSE_GRAPHICS_CONTEXT 1 +# else + // MSVC 6 didn't include GDI+ headers so disable by default, enable it + // here if you use MSVC 6 with a newer SDK +# define wxUSE_GRAPHICS_CONTEXT 0 +# endif #else - #define wxUSE_GRAPHICS_CONTEXT 0 + // Disable support for other Windows compilers, enable it if your compiler + // comes with new enough SDK or you installed the headers manually. + // + // Notice that this will be set by configure under non-Windows platforms + // anyhow so the value there is not important. +# define wxUSE_GRAPHICS_CONTEXT 0 #endif // ---------------------------------------------------------------------------- diff --git a/include/wx/os2/setup0.h b/include/wx/os2/setup0.h index 40186f83bb..9629934fe3 100644 --- a/include/wx/os2/setup0.h +++ b/include/wx/os2/setup0.h @@ -666,11 +666,27 @@ // mingw32) you may need to install the headers (and just the headers) // yourself. If you do, change the setting below manually. // -// Recommended setting: 1 -#if !defined(__WXMSW__) || wxCHECK_VISUALC_VERSION(7) - #define wxUSE_GRAPHICS_CONTEXT 1 +// Recommended setting: 1 if supported by the compilation environment + +// notice that we can't use wxCHECK_VISUALC_VERSION() here as this file is +// included from wx/platform.h before wxCHECK_VISUALC_VERSION() is defined +#ifdef _MSC_VER +# if _MSC_VER >= 1400 + // MSVC7+ comes with new enough Platform SDK, enable wxGraphicsContext + // support for it +# define wxUSE_GRAPHICS_CONTEXT 1 +# else + // MSVC 6 didn't include GDI+ headers so disable by default, enable it + // here if you use MSVC 6 with a newer SDK +# define wxUSE_GRAPHICS_CONTEXT 0 +# endif #else - #define wxUSE_GRAPHICS_CONTEXT 0 + // Disable support for other Windows compilers, enable it if your compiler + // comes with new enough SDK or you installed the headers manually. + // + // Notice that this will be set by configure under non-Windows platforms + // anyhow so the value there is not important. +# define wxUSE_GRAPHICS_CONTEXT 0 #endif // ---------------------------------------------------------------------------- diff --git a/include/wx/osx/setup0.h b/include/wx/osx/setup0.h index b044bbfa6a..709bc320b6 100644 --- a/include/wx/osx/setup0.h +++ b/include/wx/osx/setup0.h @@ -667,11 +667,27 @@ // mingw32) you may need to install the headers (and just the headers) // yourself. If you do, change the setting below manually. // -// Recommended setting: 1 -#if !defined(__WXMSW__) || wxCHECK_VISUALC_VERSION(7) - #define wxUSE_GRAPHICS_CONTEXT 1 +// Recommended setting: 1 if supported by the compilation environment + +// notice that we can't use wxCHECK_VISUALC_VERSION() here as this file is +// included from wx/platform.h before wxCHECK_VISUALC_VERSION() is defined +#ifdef _MSC_VER +# if _MSC_VER >= 1400 + // MSVC7+ comes with new enough Platform SDK, enable wxGraphicsContext + // support for it +# define wxUSE_GRAPHICS_CONTEXT 1 +# else + // MSVC 6 didn't include GDI+ headers so disable by default, enable it + // here if you use MSVC 6 with a newer SDK +# define wxUSE_GRAPHICS_CONTEXT 0 +# endif #else - #define wxUSE_GRAPHICS_CONTEXT 0 + // Disable support for other Windows compilers, enable it if your compiler + // comes with new enough SDK or you installed the headers manually. + // + // Notice that this will be set by configure under non-Windows platforms + // anyhow so the value there is not important. +# define wxUSE_GRAPHICS_CONTEXT 0 #endif // ---------------------------------------------------------------------------- diff --git a/include/wx/palmos/setup0.h b/include/wx/palmos/setup0.h index 3f2f2e10cd..8b67622a11 100644 --- a/include/wx/palmos/setup0.h +++ b/include/wx/palmos/setup0.h @@ -666,11 +666,27 @@ // mingw32) you may need to install the headers (and just the headers) // yourself. If you do, change the setting below manually. // -// Recommended setting: 1 -#if !defined(__WXMSW__) || wxCHECK_VISUALC_VERSION(7) - #define wxUSE_GRAPHICS_CONTEXT 1 +// Recommended setting: 1 if supported by the compilation environment + +// notice that we can't use wxCHECK_VISUALC_VERSION() here as this file is +// included from wx/platform.h before wxCHECK_VISUALC_VERSION() is defined +#ifdef _MSC_VER +# if _MSC_VER >= 1400 + // MSVC7+ comes with new enough Platform SDK, enable wxGraphicsContext + // support for it +# define wxUSE_GRAPHICS_CONTEXT 1 +# else + // MSVC 6 didn't include GDI+ headers so disable by default, enable it + // here if you use MSVC 6 with a newer SDK +# define wxUSE_GRAPHICS_CONTEXT 0 +# endif #else - #define wxUSE_GRAPHICS_CONTEXT 0 + // Disable support for other Windows compilers, enable it if your compiler + // comes with new enough SDK or you installed the headers manually. + // + // Notice that this will be set by configure under non-Windows platforms + // anyhow so the value there is not important. +# define wxUSE_GRAPHICS_CONTEXT 0 #endif // ---------------------------------------------------------------------------- diff --git a/include/wx/setup_inc.h b/include/wx/setup_inc.h index 39b22a1219..59ee2bec16 100644 --- a/include/wx/setup_inc.h +++ b/include/wx/setup_inc.h @@ -662,11 +662,27 @@ // mingw32) you may need to install the headers (and just the headers) // yourself. If you do, change the setting below manually. // -// Recommended setting: 1 -#if !defined(__WXMSW__) || wxCHECK_VISUALC_VERSION(7) - #define wxUSE_GRAPHICS_CONTEXT 1 +// Recommended setting: 1 if supported by the compilation environment + +// notice that we can't use wxCHECK_VISUALC_VERSION() here as this file is +// included from wx/platform.h before wxCHECK_VISUALC_VERSION() is defined +#ifdef _MSC_VER +# if _MSC_VER >= 1400 + // MSVC7+ comes with new enough Platform SDK, enable wxGraphicsContext + // support for it +# define wxUSE_GRAPHICS_CONTEXT 1 +# else + // MSVC 6 didn't include GDI+ headers so disable by default, enable it + // here if you use MSVC 6 with a newer SDK +# define wxUSE_GRAPHICS_CONTEXT 0 +# endif #else - #define wxUSE_GRAPHICS_CONTEXT 0 + // Disable support for other Windows compilers, enable it if your compiler + // comes with new enough SDK or you installed the headers manually. + // + // Notice that this will be set by configure under non-Windows platforms + // anyhow so the value there is not important. +# define wxUSE_GRAPHICS_CONTEXT 0 #endif // ---------------------------------------------------------------------------- diff --git a/include/wx/univ/setup0.h b/include/wx/univ/setup0.h index 425ce4c0c4..8bb1f531c7 100644 --- a/include/wx/univ/setup0.h +++ b/include/wx/univ/setup0.h @@ -665,11 +665,27 @@ // mingw32) you may need to install the headers (and just the headers) // yourself. If you do, change the setting below manually. // -// Recommended setting: 1 -#if !defined(__WXMSW__) || wxCHECK_VISUALC_VERSION(7) - #define wxUSE_GRAPHICS_CONTEXT 1 +// Recommended setting: 1 if supported by the compilation environment + +// notice that we can't use wxCHECK_VISUALC_VERSION() here as this file is +// included from wx/platform.h before wxCHECK_VISUALC_VERSION() is defined +#ifdef _MSC_VER +# if _MSC_VER >= 1400 + // MSVC7+ comes with new enough Platform SDK, enable wxGraphicsContext + // support for it +# define wxUSE_GRAPHICS_CONTEXT 1 +# else + // MSVC 6 didn't include GDI+ headers so disable by default, enable it + // here if you use MSVC 6 with a newer SDK +# define wxUSE_GRAPHICS_CONTEXT 0 +# endif #else - #define wxUSE_GRAPHICS_CONTEXT 0 + // Disable support for other Windows compilers, enable it if your compiler + // comes with new enough SDK or you installed the headers manually. + // + // Notice that this will be set by configure under non-Windows platforms + // anyhow so the value there is not important. +# define wxUSE_GRAPHICS_CONTEXT 0 #endif // ---------------------------------------------------------------------------- diff --git a/setup.h.in b/setup.h.in index 0519dabb7d..c97a5cbfe3 100644 --- a/setup.h.in +++ b/setup.h.in @@ -323,10 +323,24 @@ #define wxUSE_STC 0 -#if !defined(__WXMSW__) || wxCHECK_VISUALC_VERSION(7) - #define wxUSE_GRAPHICS_CONTEXT 0 + +#ifdef _MSC_VER +# if _MSC_VER >= 1400 + + +#define wxUSE_GRAPHICS_CONTEXT 0 +# else + + +# define wxUSE_GRAPHICS_CONTEXT 0 +# endif #else - #define wxUSE_GRAPHICS_CONTEXT 0 + + + + + +# define wxUSE_GRAPHICS_CONTEXT 0 #endif -- 2.45.2