Merge branch 'ansi-fix'

Fix wxMSW compilation errors in non-Unicode build.

See https://github.com/wxWidgets/wxWidgets/pull/858

Closes #18172.
This commit is contained in:
Vadim Zeitlin
2018-07-24 15:15:28 +02:00
3 changed files with 5 additions and 13 deletions

View File

@@ -118,6 +118,7 @@ wxMSW:
- Fix positioning windows at positions >= SHORT_MAX (Cătălin Răceanu). - Fix positioning windows at positions >= SHORT_MAX (Cătălin Răceanu).
- Honour alignment flags for multiline buttons using custom colours too. - Honour alignment flags for multiline buttons using custom colours too.
- Support MSVC auto-linking when using monolithic build too (PB). - Support MSVC auto-linking when using monolithic build too (PB).
- Fix build in ANSI (non-Unicode) mode.
wxOSX: wxOSX:

View File

@@ -3839,9 +3839,11 @@ public:
// wxString comparison functions: operator versions are always case sensitive // wxString comparison functions: operator versions are always case sensitive
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// comparison with C-style narrow and wide strings.
#define wxCMP_WXCHAR_STRING(p, s, op) 0 op s.Cmp(p) #define wxCMP_WXCHAR_STRING(p, s, op) 0 op s.Cmp(p)
wxDEFINE_ALL_COMPARISONS(const wxChar *, const wxString&, wxCMP_WXCHAR_STRING) wxDEFINE_ALL_COMPARISONS(const wchar_t *, const wxString&, wxCMP_WXCHAR_STRING)
wxDEFINE_ALL_COMPARISONS(const char *, const wxString&, wxCMP_WXCHAR_STRING)
#undef wxCMP_WXCHAR_STRING #undef wxCMP_WXCHAR_STRING
@@ -3930,17 +3932,6 @@ inline bool wxString::iterator::operator<=(const const_iterator& i) const
inline bool wxString::iterator::operator>=(const const_iterator& i) const inline bool wxString::iterator::operator>=(const const_iterator& i) const
{ return i <= *this; } { return i <= *this; }
// comparison with C string in Unicode build
#if wxUSE_UNICODE
#define wxCMP_CHAR_STRING(p, s, op) wxString(p) op s
wxDEFINE_ALL_COMPARISONS(const char *, const wxString&, wxCMP_CHAR_STRING)
#undef wxCMP_CHAR_STRING
#endif // wxUSE_UNICODE
// we also need to provide the operators for comparison with wxCStrData to // we also need to provide the operators for comparison with wxCStrData to
// resolve ambiguity between operator(const wxChar *,const wxString &) and // resolve ambiguity between operator(const wxChar *,const wxString &) and
// operator(const wxChar *, const wxChar *) for "p == s.c_str()" // operator(const wxChar *, const wxChar *) for "p == s.c_str()"

View File

@@ -2335,7 +2335,7 @@ void wxGDIPlusRenderer::Load()
for ( size_t i = 0 ; i < n; i++ ) for ( size_t i = 0 ; i < n; i++ )
{ {
const wxString& fname = privateFonts[i]; const wxString& fname = privateFonts[i];
gs_privateFonts->AddFontFile(fname.t_str()); gs_privateFonts->AddFontFile(fname.wc_str());
} }
gs_pFontFamily = new Gdiplus::FontFamily[n]; gs_pFontFamily = new Gdiplus::FontFamily[n];