better compatibility with old wxList in wxUSE_STL==1 mode (patch 1075432)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32418 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-02-27 15:40:39 +00:00
parent 37da386f77
commit ed1288c1d5
4 changed files with 183 additions and 110 deletions

View File

@@ -11,23 +11,28 @@
#if wxUSE_STL
#undef WX_DEFINE_LIST
#define WX_DEFINE_LIST(name)
#undef WX_DEFINE_LIST
#define WX_DEFINE_LIST(name) \
void name::DeleteFunction( const _WX_LIST_ITEM_TYPE_##name X ) \
{ \
delete X; \
}
#else // if !wxUSE_STL
#define _DEFINE_LIST(T, name) \
void wx##name##Node::DeleteData() \
{ \
delete (T *)GetData(); \
}
#define _DEFINE_LIST(T, name) \
void wx##name##Node::DeleteData() \
{ \
delete (T *)GetData(); \
}
// redefine the macro so that now it will generate the class implementation
// old value would provoke a compile-time error if this file is not included
#undef WX_DEFINE_LIST
#define WX_DEFINE_LIST(name) _DEFINE_LIST(_WX_LIST_ITEM_TYPE_##name, name)
// redefine the macro so that now it will generate the class implementation
// old value would provoke a compile-time error if this file is not included
#undef WX_DEFINE_LIST
#define WX_DEFINE_LIST(name) _DEFINE_LIST(_WX_LIST_ITEM_TYPE_##name, name)
// don't pollute preprocessor's name space
//#undef _DEFINE_LIST
// don't pollute preprocessor's name space
//#undef _DEFINE_LIST
#endif