compilation fixes for wxAnyStrPtr for VC6

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59824 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-03-25 00:44:25 +00:00
parent 8057186b81
commit c5e8b33639
2 changed files with 30 additions and 3 deletions

View File

@@ -61,6 +61,11 @@ public:
// different conversions to pointers)
operator bool() const { return m_str != NULL; }
#ifdef __VISUALC6__
// FIXME-VC6: it also needs this one or it complains about ambiguity
bool operator!() const { return !((bool)*this); }
#endif // __VISUALC6__
// and these are the conversions operator which allow to assign the result
// of FuncReturningAnyStrPtr() to either char* or wxChar* (i.e. wchar_t*)
@@ -132,5 +137,14 @@ private:
wxDECLARE_NO_ASSIGN_CLASS(wxAnyStrPtr);
};
// FIXME-VC6: expressions involving logical operations are not compiled
// correctly without these operators
#ifdef __VISUALC6__
inline bool operator||(const wxAnyStrPtr& p, bool v) { return (bool)p || v; }
inline bool operator||(bool v, const wxAnyStrPtr& p) { return v || (bool)p; }
inline bool operator&&(const wxAnyStrPtr& p, bool v) { return (bool)p && v; }
inline bool operator&&(bool v, const wxAnyStrPtr& p) { return v && (bool)p; }
#endif // __VISUALC6__
#endif // _WX_ANYSTR_H_