Add support for passing nullptr to wx pseudo-vararg functions

Allow passing literal nullptr as an argument corresponding to "%p" in
the format string.

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

Closes #18355.
This commit is contained in:
Vadim Zeitlin
2019-03-08 16:13:00 +01:00
parent f33ee85566
commit 5a78b82673
2 changed files with 13 additions and 0 deletions

View File

@@ -425,6 +425,12 @@ wxFORMAT_STRING_SPECIFIER(int*, wxFormatString::Arg_IntPtr | wxFormatString::Arg
wxFORMAT_STRING_SPECIFIER(short int*, wxFormatString::Arg_ShortIntPtr | wxFormatString::Arg_Pointer)
wxFORMAT_STRING_SPECIFIER(long int*, wxFormatString::Arg_LongIntPtr | wxFormatString::Arg_Pointer)
// Support for nullptr is available since MSVS 2010, even though it doesn't
// define __cplusplus as a C++11 compiler.
#if __cplusplus >= 201103 || wxCHECK_VISUALC_VERSION(10)
wxFORMAT_STRING_SPECIFIER(std::nullptr_t, wxFormatString::Arg_Pointer)
#endif
#undef wxFORMAT_STRING_SPECIFIER