From 9565aaf469dfa8dd3a82fd57f10e782d55e22b03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=2E=20Col=C3=B3n=20V=C3=A9lez?= Date: Sat, 22 Aug 2015 10:30:11 -0400 Subject: [PATCH] Backport wx30 fix for VS2015. This is commit f350babf36818ba805ab0b4510b6616aaf3063fc. . Reading "Please update wx/compiler.h to recognize this VC++ version" gets old pretty quickly. --- 3rdparty/wxwidgets3.0/include/msvc/wx/setup.h | 2 ++ 3rdparty/wxwidgets3.0/include/wx/compiler.h | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/3rdparty/wxwidgets3.0/include/msvc/wx/setup.h b/3rdparty/wxwidgets3.0/include/msvc/wx/setup.h index 0ae5bbd7ff..4f508af7c8 100644 --- a/3rdparty/wxwidgets3.0/include/msvc/wx/setup.h +++ b/3rdparty/wxwidgets3.0/include/msvc/wx/setup.h @@ -63,6 +63,8 @@ #define wxCOMPILER_PREFIX vc110 #elif _MSC_VER == 1800 #define wxCOMPILER_PREFIX vc120 + #elif _MSC_VER == 1900 + #define wxCOMPILER_PREFIX vc140 #else #error "Unknown MSVC compiler version, please report to wx-dev." #endif diff --git a/3rdparty/wxwidgets3.0/include/wx/compiler.h b/3rdparty/wxwidgets3.0/include/wx/compiler.h index db8a7d36e0..c10f669453 100644 --- a/3rdparty/wxwidgets3.0/include/wx/compiler.h +++ b/3rdparty/wxwidgets3.0/include/wx/compiler.h @@ -53,7 +53,14 @@ # define __VISUALC11__ #elif __VISUALC__ < 1900 # define __VISUALC12__ +#elif __VISUALC__ < 2000 + /* There is no __VISUALC13__! */ +# define __VISUALC14__ #else + /* + Don't forget to update include/msvc/wx/setup.h as well when adding + support for a newer MSVC version here. + */ # pragma message("Please update wx/compiler.h to recognize this VC++ version") #endif @@ -102,7 +109,13 @@ # define wxVISUALC_VERSION(major) 0 # define wxCHECK_VISUALC_VERSION(major) 0 #else -# define wxVISUALC_VERSION(major) ( (6 + major) * 100 ) + /* + Things used to be simple with the _MSC_VER value and the version number + increasing in lock step, but _MSC_VER value of 1900 is VC14 and not the + non existing (presumably for the superstitious reasons) VC13, so we now + need to account for this with an extra offset. + */ +# define wxVISUALC_VERSION(major) ( (6 + (major >= 14 ? 1 : 0) + major) * 100 ) # define wxCHECK_VISUALC_VERSION(major) ( __VISUALC__ >= wxVISUALC_VERSION(major) ) #endif