diff --git a/include/wx/list.h b/include/wx/list.h index fb597e90aa..47281cb1d5 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -135,6 +135,13 @@ private: #endif // defined( __VISUALC__ ) +// Visual C++ 2005 complains about the const +#if defined(__VISUALC__) && __VISUALC__ >= 1400 +#define _WX_DELETEFUNCTIONCONST +#else +#define _WX_DELETEFUNCTIONCONST const +#endif + #define WX_DECLARE_LIST_XO(elT, liT, decl) \ VC6_WORKAROUND(elT, liT, decl) \ decl liT : public std::list \ @@ -143,7 +150,7 @@ private: bool m_destroy; \ private: \ typedef elT _WX_LIST_ITEM_TYPE_##liT; \ - static void DeleteFunction( const _WX_LIST_ITEM_TYPE_##liT X ); \ + static void DeleteFunction( _WX_DELETEFUNCTIONCONST _WX_LIST_ITEM_TYPE_##liT X ); \ public: \ class compatibility_iterator \ { \ diff --git a/include/wx/listimpl.cpp b/include/wx/listimpl.cpp index 11d0196a4e..f5a0fc4bf7 100644 --- a/include/wx/listimpl.cpp +++ b/include/wx/listimpl.cpp @@ -13,7 +13,7 @@ #undef WX_DEFINE_LIST #define WX_DEFINE_LIST(name) \ - void name::DeleteFunction( const _WX_LIST_ITEM_TYPE_##name X ) \ + void name::DeleteFunction( _WX_DELETEFUNCTIONCONST _WX_LIST_ITEM_TYPE_##name X ) \ { \ delete X; \ }