From 6724f8c0523ad4b14ea04dc2977013f6ff8c7589 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 2 Feb 2020 01:12:28 +0100 Subject: [PATCH] Work around MSVS 2012 bug with handling of nullptr Avoid error C2180 given by this compiler for if statements with controlling expression of type nullptr_t. --- include/wx/wxcrt.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/wx/wxcrt.h b/include/wx/wxcrt.h index e8bdc628c2..9f17dc759b 100644 --- a/include/wx/wxcrt.h +++ b/include/wx/wxcrt.h @@ -858,7 +858,8 @@ template<> struct wxStrtoxCharType template inline double wxStrtod(const wxString& nptr, T endptr) { - if (endptr) + // Explicit comparison with 0 required when using T=nullptr with MSVS 2012. + if (endptr != 0) { // note that it is important to use c_str() here and not mb_str() or // wc_str(), because we store the pointer into (possibly converted)