diff --git a/docs/doxygen/mainpages/const_cpp.h b/docs/doxygen/mainpages/const_cpp.h index ce7a5f1f8e..379e9ee3ec 100644 --- a/docs/doxygen/mainpages/const_cpp.h +++ b/docs/doxygen/mainpages/const_cpp.h @@ -187,6 +187,7 @@ Currently the following symbols exist: @itemdef{wxHAS_MULTIPLE_FILEDLG_FILTERS, Defined if wxFileDialog supports multiple ('|'-separated) filters.} @itemdef{wxHAS_NATIVE_DATAVIEWCTRL, Defined if native wxDataViewCtrl class is being used (this symbol only exists in wxWidgets 3.1.4 and later).} @itemdef{wxHAS_NATIVE_WINDOW, Defined if wxNativeWindow class is available.} +@itemdef{wxHAS_NULLPTR_T, Defined if the currently used compiler supports C++11 @c nullptr.} @itemdef{wxHAS_IMAGES_IN_RESOURCES, Defined if Windows resource files or OS/2 resource files are available on the current platform.} @itemdef{wxHAS_POWER_EVENTS, Defined if wxPowerEvent are ever generated on the current platform.} diff --git a/include/wx/defs.h b/include/wx/defs.h index 2bb24814fd..a7472b60b3 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -285,6 +285,14 @@ typedef short int WXTYPE; #define wxOVERRIDE #endif /* HAVE_OVERRIDE */ +/* + 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) + #define wxHAS_NULLPTR_T +#endif + /* wxFALLTHROUGH is used to notate explicit fallthroughs in switch statements */ #if __cplusplus >= 201703L diff --git a/include/wx/strvararg.h b/include/wx/strvararg.h index 2af4d79734..82cb94536f 100644 --- a/include/wx/strvararg.h +++ b/include/wx/strvararg.h @@ -425,9 +425,7 @@ 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) +#ifdef wxHAS_NULLPTR_T wxFORMAT_STRING_SPECIFIER(std::nullptr_t, wxFormatString::Arg_Pointer) #endif