compilation fix for VC6 (patch 1158433)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32647 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -99,30 +99,40 @@ enum wxKeyType
|
|||||||
WX_DECLARE_LIST_XO(elT*, liT, decl)
|
WX_DECLARE_LIST_XO(elT*, liT, decl)
|
||||||
|
|
||||||
#define WX_DECLARE_LIST_XO(elT, liT, decl) \
|
#define WX_DECLARE_LIST_XO(elT, liT, decl) \
|
||||||
|
decl liT; \
|
||||||
|
\
|
||||||
|
/* Workaround for broken VC6 STL incorrectly requires a std::greater<> */ \
|
||||||
|
/* to be passed into std::list::sort() */ \
|
||||||
|
template <> \
|
||||||
|
struct std::greater<elT> \
|
||||||
|
{ \
|
||||||
|
private: \
|
||||||
|
wxSortCompareFunction m_CompFunc; \
|
||||||
|
public: \
|
||||||
|
greater( wxSortCompareFunction compfunc = NULL ) \
|
||||||
|
: m_CompFunc( compfunc ) {} \
|
||||||
|
bool operator()(const elT X, const elT Y) const \
|
||||||
|
{ \
|
||||||
|
return m_CompFunc ? \
|
||||||
|
( m_CompFunc( X, Y ) < 0 ) : \
|
||||||
|
( X > Y ); \
|
||||||
|
} \
|
||||||
|
}; \
|
||||||
|
\
|
||||||
decl liT : public std::list<elT> \
|
decl liT : public std::list<elT> \
|
||||||
{ \
|
{ \
|
||||||
private: \
|
private: \
|
||||||
bool m_destroy; \
|
bool m_destroy; \
|
||||||
private: \
|
private: \
|
||||||
class SortCompareFunction \
|
|
||||||
{ \
|
|
||||||
private: \
|
|
||||||
wxSortCompareFunction m_CompFunc; \
|
|
||||||
public: \
|
|
||||||
SortCompareFunction( wxSortCompareFunction compfunc ) \
|
|
||||||
: m_CompFunc( compfunc ) {} \
|
|
||||||
bool operator()( const elT X, const elT Y ) const \
|
|
||||||
{ return ( m_CompFunc( X, Y ) < 0 ); } \
|
|
||||||
}; \
|
|
||||||
\
|
|
||||||
typedef elT _WX_LIST_ITEM_TYPE_##liT; \
|
typedef elT _WX_LIST_ITEM_TYPE_##liT; \
|
||||||
static void DeleteFunction( const _WX_LIST_ITEM_TYPE_##liT X ); \
|
static void DeleteFunction( const _WX_LIST_ITEM_TYPE_##liT X ); \
|
||||||
public: \
|
public: \
|
||||||
class compatibility_iterator \
|
class compatibility_iterator \
|
||||||
{ \
|
{ \
|
||||||
private: \
|
private: \
|
||||||
typedef liT::iterator iterator; \
|
/* Workaround for broken VC6 nested class name resolution */ \
|
||||||
friend class liT; \
|
typedef std::list<elT>::iterator iterator; \
|
||||||
|
friend class liT; \
|
||||||
private: \
|
private: \
|
||||||
iterator m_iter; \
|
iterator m_iter; \
|
||||||
liT * m_list; \
|
liT * m_list; \
|
||||||
@@ -260,8 +270,9 @@ enum wxKeyType
|
|||||||
clear(); \
|
clear(); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
|
/* Workaround for broken VC6 std::list::sort() see above */ \
|
||||||
void Sort( wxSortCompareFunction compfunc ) \
|
void Sort( wxSortCompareFunction compfunc ) \
|
||||||
{ sort( SortCompareFunction( compfunc ) ); } \
|
{ sort( std::greater<elT>( compfunc ) ); } \
|
||||||
\
|
\
|
||||||
~liT() { Clear(); } \
|
~liT() { Clear(); } \
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user