From 9db8162da585cec2a7d29d6c0127dfd0af0219be Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 8 May 2014 14:43:32 +0000 Subject: [PATCH] Do export wxMSWOwnerDrawnButton from DLL in wxMSW. This class shouldn't need to be exported but not doing it breaks builds using LTCG with Intel compiler, so do export it to avoid this problem. Closes #16237. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76485 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/checkbox.h | 11 ----------- include/wx/msw/ownerdrawnbutton.h | 15 ++++++++------- include/wx/msw/radiobut.h | 11 ----------- 3 files changed, 8 insertions(+), 29 deletions(-) diff --git a/include/wx/msw/checkbox.h b/include/wx/msw/checkbox.h index bc2eaf460b..7370ad6f11 100644 --- a/include/wx/msw/checkbox.h +++ b/include/wx/msw/checkbox.h @@ -13,13 +13,6 @@ #include "wx/msw/ownerdrawnbutton.h" -#ifdef __VISUALC__ - // Disable the warning about non DLL-exported wxMSWOwnerDrawnButton class - // used as base for DLL-exported class: it's harmless in this case. - #pragma warning(push) - #pragma warning(disable:4275) -#endif - // Checkbox item (single checkbox) class WXDLLIMPEXP_CORE wxCheckBox : public wxMSWOwnerDrawnButton { @@ -84,8 +77,4 @@ private: DECLARE_DYNAMIC_CLASS_NO_COPY(wxCheckBox) }; -#ifdef __VISUALC__ - #pragma warning(pop) -#endif - #endif // _WX_CHECKBOX_H_ diff --git a/include/wx/msw/ownerdrawnbutton.h b/include/wx/msw/ownerdrawnbutton.h index 527a9c2529..99843e62af 100644 --- a/include/wx/msw/ownerdrawnbutton.h +++ b/include/wx/msw/ownerdrawnbutton.h @@ -17,11 +17,11 @@ // This class contains the type-independent part of wxMSWOwnerDrawnButton and // is implemented in src/msw/control.cpp. // -// Notice that it is intentionally not DLL-exported, it is internal -// implementation detail only. However MSVS generates a warning C4275 when -// deriving from the non-exported classes, so it needs to be explicitly -// disabled when deriving from this one. -class wxMSWOwnerDrawnButtonBase +// Notice that this class is internal implementation detail only and is +// intentionally not documented. Ideally it wouldn't be even exported from the +// DLL but this somehow breaks building of applications using wxWidgets with +// Intel compiler using LTCG, so we do export it. +class WXDLLIMPEXP_CORE wxMSWOwnerDrawnButtonBase { protected: // Ctor takes the back pointer to the real window, must be non-NULL. @@ -91,8 +91,9 @@ private: // This class uses a weak version of CRTP, i.e. it's a template class taking // the base class that the class deriving from it would normally derive from. template -class wxMSWOwnerDrawnButton : public T, - private wxMSWOwnerDrawnButtonBase +class WXDLLIMPEXP_CORE wxMSWOwnerDrawnButton + : public T, + private wxMSWOwnerDrawnButtonBase { private: typedef T Base; diff --git a/include/wx/msw/radiobut.h b/include/wx/msw/radiobut.h index a7da5f3f7d..76fc661b9c 100644 --- a/include/wx/msw/radiobut.h +++ b/include/wx/msw/radiobut.h @@ -13,13 +13,6 @@ #include "wx/msw/ownerdrawnbutton.h" -#ifdef __VISUALC__ - // Disable the warning about non DLL-exported wxMSWOwnerDrawnButton class - // used as base for DLL-exported class: it's harmless in this case. - #pragma warning(push) - #pragma warning(disable:4275) -#endif - class WXDLLIMPEXP_CORE wxRadioButton : public wxMSWOwnerDrawnButton { public: @@ -85,8 +78,4 @@ private: DECLARE_DYNAMIC_CLASS_NO_COPY(wxRadioButton) }; -#ifdef __VISUALC__ - #pragma warning(pop) -#endif - #endif // _WX_RADIOBUT_H_