Define wxHAS_NULLPTR_T if nullptr is supported

This is necessary because MSVS versions as old as 2010 support it, even
if they don't have full C++11 support and so don't define __cplusplus
appropriately.

Extract the existing check for nullptr from wx/strvararg.h to wx/defs.h
in order to allow reusing it.
This commit is contained in:
Vadim Zeitlin
2020-01-31 17:11:50 +01:00
parent c34a7a2e30
commit 7969f3f81c
3 changed files with 10 additions and 3 deletions

View File

@@ -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