From b3b93c582ae82e56ff779f2ff2931f091002cbff Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 14 Oct 2013 15:08:45 +0000 Subject: [PATCH] Don't undefine __WXMSW__ for console mode applications using wxWidgets. This partially undoes the changes of r73290 by keeping __WXMSW__ defined for the console mode user applications and only undefining it when building wxWidgets itself. This allows the existing code using __WXMSW__ to continue compiling correctly with wxWidgets 3.0. Closes #15579. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75006 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/doxygen/mainpages/const_cpp.h | 5 ++++- include/wx/platform.h | 9 +++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/doxygen/mainpages/const_cpp.h b/docs/doxygen/mainpages/const_cpp.h index 8b827cf3a3..9ae6d42f4f 100644 --- a/docs/doxygen/mainpages/const_cpp.h +++ b/docs/doxygen/mainpages/const_cpp.h @@ -36,7 +36,10 @@ using @ifdef_ and not @if_. @itemdef{__WXMAC__, old define, same as @c __WXOSX__} @itemdef{__WXMOTIF__, Motif} @itemdef{__WXMOTIF20__, Motif 2.0 or higher} -@itemdef{__WXMSW__, GUI using Windows Controls} +@itemdef{__WXMSW__, GUI using Windows Controls. +Notice that for compatibility reasons, this symbol is defined for console +applications under Windows as well, but it should only be used in the GUI code +while @c __WINDOWS__ should be used for the platform tests.} @itemdef{__WXOSX__, OS X GUI using any Apple widget framework (Carbon, AppKit or UIKit)} @itemdef{__WXOSX_IPHONE__, OS X iPhone (UIKit)} @itemdef{__WXOSX_CARBON__, Mac OS X using Carbon} diff --git a/include/wx/platform.h b/include/wx/platform.h index 53b04e522d..97c669f7a4 100644 --- a/include/wx/platform.h +++ b/include/wx/platform.h @@ -95,8 +95,13 @@ # endif #endif /* __WINDOWS__ */ -/* Don't use widget toolkit specific code in non-GUI code */ -#if defined(wxUSE_GUI) && !wxUSE_GUI +/* + Don't use widget toolkit specific code in non-GUI code in the library + itself to ensure that the same base library is used for both MSW and GTK + ports. But keep __WXMSW__ defined for (console) applications using + wxWidgets for compatibility. + */ +#if defined(WXBUILDING) && defined(wxUSE_GUI) && !wxUSE_GUI # ifdef __WXMSW__ # undef __WXMSW__ # endif