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
This commit is contained in:
Vadim Zeitlin
2014-05-08 14:43:32 +00:00
parent e532b3f234
commit 9db8162da5
3 changed files with 8 additions and 29 deletions

View File

@@ -13,13 +13,6 @@
#include "wx/msw/ownerdrawnbutton.h" #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) // Checkbox item (single checkbox)
class WXDLLIMPEXP_CORE wxCheckBox : public wxMSWOwnerDrawnButton<wxCheckBoxBase> class WXDLLIMPEXP_CORE wxCheckBox : public wxMSWOwnerDrawnButton<wxCheckBoxBase>
{ {
@@ -84,8 +77,4 @@ private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxCheckBox) DECLARE_DYNAMIC_CLASS_NO_COPY(wxCheckBox)
}; };
#ifdef __VISUALC__
#pragma warning(pop)
#endif
#endif // _WX_CHECKBOX_H_ #endif // _WX_CHECKBOX_H_

View File

@@ -17,11 +17,11 @@
// This class contains the type-independent part of wxMSWOwnerDrawnButton and // This class contains the type-independent part of wxMSWOwnerDrawnButton and
// is implemented in src/msw/control.cpp. // is implemented in src/msw/control.cpp.
// //
// Notice that it is intentionally not DLL-exported, it is internal // Notice that this class is internal implementation detail only and is
// implementation detail only. However MSVS generates a warning C4275 when // intentionally not documented. Ideally it wouldn't be even exported from the
// deriving from the non-exported classes, so it needs to be explicitly // DLL but this somehow breaks building of applications using wxWidgets with
// disabled when deriving from this one. // Intel compiler using LTCG, so we do export it.
class wxMSWOwnerDrawnButtonBase class WXDLLIMPEXP_CORE wxMSWOwnerDrawnButtonBase
{ {
protected: protected:
// Ctor takes the back pointer to the real window, must be non-NULL. // 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 // 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. // the base class that the class deriving from it would normally derive from.
template <class T> template <class T>
class wxMSWOwnerDrawnButton : public T, class WXDLLIMPEXP_CORE wxMSWOwnerDrawnButton
private wxMSWOwnerDrawnButtonBase : public T,
private wxMSWOwnerDrawnButtonBase
{ {
private: private:
typedef T Base; typedef T Base;

View File

@@ -13,13 +13,6 @@
#include "wx/msw/ownerdrawnbutton.h" #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<wxControl> class WXDLLIMPEXP_CORE wxRadioButton : public wxMSWOwnerDrawnButton<wxControl>
{ {
public: public:
@@ -85,8 +78,4 @@ private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxRadioButton) DECLARE_DYNAMIC_CLASS_NO_COPY(wxRadioButton)
}; };
#ifdef __VISUALC__
#pragma warning(pop)
#endif
#endif // _WX_RADIOBUT_H_ #endif // _WX_RADIOBUT_H_