From 6c99dbd55e7a8ee6d2978bf7ef1b31e59b326768 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 27 Nov 2009 21:06:03 +0000 Subject: [PATCH] Define wxUSE_CAIRO in wx/chkconf.h to ensure that it's always defined. wxUSE_CAIRO used to be defined only in wx/cairo.h but this header wasn't included by src/common/dcgraph.cpp so the code there was compiled as if we were not using Cairo even when we were (thanks g++ for the warning). Define it in wx/chkconf.h (included from wx/defs.h, i.e. always) now to ensure that not only this bug is fixed but also that it can't happen any more. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62730 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/cairo.h | 9 --------- include/wx/chkconf.h | 12 ++++++++++++ src/generic/graphicc.cpp | 6 +++--- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/include/wx/cairo.h b/include/wx/cairo.h index 8dd9e7556d..0d53cca929 100644 --- a/include/wx/cairo.h +++ b/include/wx/cairo.h @@ -11,15 +11,6 @@ #ifndef _WX_CAIRO_H_BASE_ #define _WX_CAIRO_H_BASE_ -// for now GTK+ only -#ifndef wxUSE_CAIRO - #ifdef __WXGTK210__ - #define wxUSE_CAIRO 1 - #else - #define wxUSE_CAIRO 0 - #endif -#endif - #if wxUSE_CAIRO #include "wx/dynlib.h" diff --git a/include/wx/chkconf.h b/include/wx/chkconf.h index 4afa892e07..ccb3fb687a 100644 --- a/include/wx/chkconf.h +++ b/include/wx/chkconf.h @@ -431,6 +431,18 @@ # endif #endif /* !defined(wxUSE_BUTTON) */ +/* + This one is special, it's only used under wxGTK currently so don't require + pre-defining it. + */ +#ifndef wxUSE_CAIRO +# ifdef __WXGTK210__ +# define wxUSE_CAIRO 1 +# else +# define wxUSE_CAIRO 0 +# endif +#endif + #ifndef wxUSE_CALENDARCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_CALENDARCTRL must be defined, please read comment near the top of this file." diff --git a/src/generic/graphicc.cpp b/src/generic/graphicc.cpp index c6ffbd51d0..deb1b8b5e8 100644 --- a/src/generic/graphicc.cpp +++ b/src/generic/graphicc.cpp @@ -15,11 +15,11 @@ #pragma hdrstop #endif -#include "wx/cairo.h" -#include "wx/graphics.h" - #if wxUSE_GRAPHICS_CONTEXT && wxUSE_CAIRO +#include "wx/graphics.h" +#include "wx/cairo.h" + #ifndef WX_PRECOMP #include "wx/bitmap.h" #include "wx/icon.h" -- 2.45.2