Fix format strings parsing to understand C99 %zu etc.

The parser used to understand only 'Z' specifier for size_t/ptrdiff_t,
which is non-standard libc5 extension. C99 defines 'z' for this purpose,
so use that. Compatibility with 'Z' is preserved.

Also support Visual C++'s non-standard 'I' modifier with the same
meaning.

Fixes #12192.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64800 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2010-07-03 14:24:23 +00:00
parent 16c15822fe
commit b113edcdd7
2 changed files with 27 additions and 15 deletions

View File

@@ -219,4 +219,12 @@ void VarArgTestCase::ArgsValidation()
// %c should accept integers too
wxString::Format("%c", 80);
wxString::Format("%c", wxChar(80) + wxChar(1));
// check size_t handling
size_t len = sizeof(*this);
#ifdef __WXMSW__
wxString::Format("%Iu", len);
#else
wxString::Format("%zu", len);
#endif
}