add conversion of wxUniChar[Ref] to unsigned int if it's not already covered by conversion to wint_t
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45291 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -31,6 +31,12 @@
|
|||||||
#define wxIF_WINT_T_TYPE(x)
|
#define wxIF_WINT_T_TYPE(x)
|
||||||
#endif // wxWINT_T_IS_SEPARATE_TYPE/!wxWINT_T_IS_SEPARATE_TYPE
|
#endif // wxWINT_T_IS_SEPARATE_TYPE/!wxWINT_T_IS_SEPARATE_TYPE
|
||||||
|
|
||||||
|
// wchar_t seems to be defined as unsigned short by all Windows compilers but
|
||||||
|
// unsigned int everywhere else
|
||||||
|
#ifndef __WIN32__
|
||||||
|
#define wxWCHAR_T_IS_UINT
|
||||||
|
#endif
|
||||||
|
|
||||||
class WXDLLIMPEXP_BASE wxUniCharRef;
|
class WXDLLIMPEXP_BASE wxUniCharRef;
|
||||||
|
|
||||||
// This class represents single Unicode character. It can be converted to
|
// This class represents single Unicode character. It can be converted to
|
||||||
@@ -69,6 +75,9 @@ public:
|
|||||||
operator char() const { return To8bit(m_value); }
|
operator char() const { return To8bit(m_value); }
|
||||||
operator wchar_t() const { return m_value; }
|
operator wchar_t() const { return m_value; }
|
||||||
operator int() const { return m_value; }
|
operator int() const { return m_value; }
|
||||||
|
#ifndef wxWCHAR_T_IS_UINT
|
||||||
|
operator unsigned int() const { return m_value; }
|
||||||
|
#endif
|
||||||
|
|
||||||
// More conversions needed for other standard functions: uchar is for VC++
|
// More conversions needed for other standard functions: uchar is for VC++
|
||||||
// _mbxxx() ones (to which toxxx/isxxx() are mapped when _MBCS is defined)
|
// _mbxxx() ones (to which toxxx/isxxx() are mapped when _MBCS is defined)
|
||||||
@@ -184,6 +193,9 @@ public:
|
|||||||
#ifdef wxWINT_T_IS_SEPARATE_TYPE
|
#ifdef wxWINT_T_IS_SEPARATE_TYPE
|
||||||
operator wint_t() const { return UniChar(); }
|
operator wint_t() const { return UniChar(); }
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef wxWCHAR_T_IS_UINT
|
||||||
|
operator unsigned int() const { return UniChar(); }
|
||||||
|
#endif
|
||||||
|
|
||||||
// see wxUniChar::operator bool etc. for explanation
|
// see wxUniChar::operator bool etc. for explanation
|
||||||
operator bool() const { return (bool)UniChar(); }
|
operator bool() const { return (bool)UniChar(); }
|
||||||
|
Reference in New Issue
Block a user