From 6b9c622a2ef9a19cd49c6267a1bd1e29ac404a62 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 29 Jan 2008 11:14:51 +0000 Subject: [PATCH] define __VISUALCn__ for n=5,6,7,8,9 and not only 8 (should have been part of r51353) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51440 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/platform.h | 21 +++++++++++++++++++++ src/common/datetime.cpp | 7 ------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/include/wx/platform.h b/include/wx/platform.h index 328f4bc194..10f61e6cca 100644 --- a/include/wx/platform.h +++ b/include/wx/platform.h @@ -464,6 +464,27 @@ */ # if defined(_MSC_VER) && !defined(__MWERKS__) # define __VISUALC__ _MSC_VER + + /* + define special symbols for different VC version instead of writing tests + for magic numbers such as 1200, 1300 &c repeatedly + */ +# if __VISUALC__ < 1100 +# error "This Visual C++ version is too old and not supported any longer." +# elif __VISUALC__ < 1200 +# define __VISUALC5__ +# elif __VISUALC__ < 1300 +# define __VISUALC6__ +# elif __VISUALC__ < 1400 +# define __VISUALC7__ +# elif __VISUALC__ < 1500 +# define __VISUALC8__ +# elif __VISUALC__ < 1600 +# define __VISUALC9__ +# else +# pragma message("Please update this code for the next VC++ version") +# endif + # elif defined(__BCPLUSPLUS__) && !defined(__BORLANDC__) # define __BORLANDC__ # elif defined(__WATCOMC__) diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index 98e755a601..8fd992254d 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -138,13 +138,6 @@ wxCUSTOM_TYPE_INFO(wxDateTime, wxToStringConverter , wxFromStringCon #include #endif -// define a special symbol for VC8 instead of writing tests for 1400 repeatedly -#ifdef __VISUALC__ - #if __VISUALC__ >= 1400 - #define __VISUALC8__ - #endif -#endif - #if !defined(WX_TIMEZONE) && !defined(WX_GMTOFF_IN_TM) #if defined(__WXPALMOS__) #define WX_GMTOFF_IN_TM -- 2.47.2