diff --git a/src/StdString.h b/src/StdString.h index 5507d6c6fb..f1237f33b2 100644 --- a/src/StdString.h +++ b/src/StdString.h @@ -72,7 +72,7 @@ // Turn off unavoidable compiler warnings -#if defined(_MSC_VER) && (_MSC_VER > 1100) +#if defined(_MSC_VER) #pragma component(browser, off, references, "CStdString") #pragma warning (push) #pragma warning (disable : 4290) // C++ Exception Specification ignored @@ -103,16 +103,6 @@ typedef char* PSTR; #include #include -// a very shorthand way of applying the fix for KB problem Q172398 -// (basic_string assignment bug) - -#if defined ( _MSC_VER ) && ( _MSC_VER < 1200 ) - #define HAVE_ASSIGN_FIX - #define Q172398(x) (x).erase() -#else - #define Q172398(x) -#endif - /* In RageUtil: */ void MakeUpper( char *p, size_t iLen ); void MakeLower( char *p, size_t iLen ); @@ -191,27 +181,7 @@ inline void ssasn(std::string& sDst, const std::string& sSrc) */ inline void ssasn(std::string& sDst, PCSTR pA) { -#if defined(HAVE_ASSIGN_FIX) - // If pA actually points to part of sDst, we must NOT erase(), but - // rather take a substring - - if ( pA >= sDst.c_str() && pA <= sDst.c_str() + sDst.size() ) - { - sDst =sDst.substr(static_cast(pA-sDst.c_str())); - } - - // Otherwise (most cases) apply the assignment bug fix, if applicable - // and do the assignment - - else - { - Q172398(sDst); sDst.assign(pA); - } - else -#else - sDst.assign(pA); -#endif } #undef StrSizeType @@ -448,8 +418,7 @@ public: { } - // CStdStr inline assignment operators -- the ssasn function now takes care - // of fixing the MSVC assignment bug (see knowledge base article Q172398). + // CStdStr inline assignment operators MYTYPE& operator=(const MYTYPE& str) { ssasn(*this, str); @@ -470,126 +439,10 @@ public: MYTYPE& operator=(CT t) { - Q172398(*this); this->assign(1, t); return *this; } - // Overloads also needed to fix the MSVC assignment bug (KB: Q172398) - // *** Thanks to Pete The Plumber for catching this one *** - // They also are compiled if you have explicitly turned off refcounting - #if ( defined(_MSC_VER) && ( _MSC_VER < 1200 ) ) - - MYTYPE& assign(const MYTYPE& str) - { - ssasn(*this, str); - return *this; - } - - MYTYPE& assign(const MYTYPE& str, MYSIZE nStart, MYSIZE nChars) - { - // This overload of basic_string::assign is supposed to assign up to - // or the NULL terminator, whichever comes first. Since we - // are about to call a less forgiving overload (in which - // must be a valid length), we must adjust the length here to a safe - // value. Thanks to Ullrich Pollähne for catching this bug - - nChars = min(nChars, str.length() - nStart); - - // Watch out for assignment to self - - if ( this == &str ) - { - MYTYPE strTemp(str.c_str()+nStart, nChars); - MYBASE::assign(strTemp); - } - else - { - Q172398(*this); - MYBASE::assign(str.c_str()+nStart, nChars); - } - return *this; - } - - MYTYPE& assign(const MYBASE& str) - { - ssasn(*this, str); - return *this; - } - - MYTYPE& assign(const MYBASE& str, MYSIZE nStart, MYSIZE nChars) - { - // This overload of basic_string::assign is supposed to assign up to - // or the NULL terminator, whichever comes first. Since we - // are about to call a less forgiving overload (in which - // must be a valid length), we must adjust the length here to a safe - // value. Thanks to Ullrich Pollähne for catching this bug - - nChars = min(nChars, str.length() - nStart); - - // Watch out for assignment to self - - if ( this == &str ) // watch out for assignment to self - { - MYTYPE strTemp(str.c_str() + nStart, nChars); - MYBASE::assign(strTemp); - } - else - { - Q172398(*this); - MYBASE::assign(str.c_str()+nStart, nChars); - } - return *this; - } - - MYTYPE& assign(const CT* pC, MYSIZE nChars) - { - // Q172398 only fix -- erase before assigning, but not if we're - // assigning from our own buffer - - #if defined ( _MSC_VER ) && ( _MSC_VER < 1200 ) - if ( !this->empty() && - ( pC < this->data() || pC > this->data() + this->capacity() ) ) - { - this->erase(); - } - #endif - MYBASE::assign(pC, nChars); - return *this; - } - - MYTYPE& assign(MYSIZE nChars, MYVAL val) - { - Q172398(*this); - MYBASE::assign(nChars, val); - return *this; - } - - MYTYPE& assign(const CT* pT) - { - return this->assign(pT, MYBASE::traits_type::length(pT)); - } - - MYTYPE& assign(MYCITER iterFirst, MYCITER iterLast) - { - #if defined ( _MSC_VER ) && ( _MSC_VER < 1200 ) - // Q172398 fix. don't call erase() if we're assigning from ourself - if ( iterFirst < this->begin() || iterFirst > this->begin() + this->size() ) - this->erase() - #endif - this->replace(this->begin(), this->end(), iterFirst, iterLast); - return *this; - } - #endif - - /* VC6 string is missing clear(). */ - #if defined(_MSC_VER) && ( _MSC_VER < 1300 ) /* VC6, not VC7 */ - void clear() - { - this->erase(); - } - #endif - // ------------------------------------------------------------------------- // CStdStr inline concatenation. // ------------------------------------------------------------------------- @@ -619,17 +472,10 @@ public: // addition operators -- global friend functions. - -#if defined(_MSC_VER) && _MSC_VER < 1300 /* VC6, not VC7 */ -/* work around another stupid vc6 bug */ -#define EMP_TEMP -#else -#define EMP_TEMP <> -#endif - friend MYTYPE operator+ EMP_TEMP(const MYTYPE& str1, const MYTYPE& str2); - friend MYTYPE operator+ EMP_TEMP(const MYTYPE& str, CT t); - friend MYTYPE operator+ EMP_TEMP(const MYTYPE& str, PCSTR sz); - friend MYTYPE operator+ EMP_TEMP(PCSTR pA, const MYTYPE& str); + friend MYTYPE operator+ <>(const MYTYPE& str1, const MYTYPE& str2); + friend MYTYPE operator+ <>(const MYTYPE& str, CT t); + friend MYTYPE operator+ <>(const MYTYPE& str, PCSTR sz); + friend MYTYPE operator+ <>(PCSTR pA, const MYTYPE& str); // ------------------------------------------------------------------------- // Case changing functions @@ -833,7 +679,7 @@ struct StdStringEqualsNoCase } // namespace StdString -#if defined(_MSC_VER) && (_MSC_VER > 1100) +#if defined(_MSC_VER) #pragma warning (pop) #endif diff --git a/src/arch/ArchHooks/ArchHooks_Win32.cpp b/src/arch/ArchHooks/ArchHooks_Win32.cpp index 15865eca4d..7d31c6b4fa 100644 --- a/src/arch/ArchHooks/ArchHooks_Win32.cpp +++ b/src/arch/ArchHooks/ArchHooks_Win32.cpp @@ -15,13 +15,11 @@ static HANDLE g_hInstanceMutex; static bool g_bIsMultipleInstance = false; -#if _MSC_VER >= 1400 // VC8 void InvalidParameterHandler( const wchar_t *szExpression, const wchar_t *szFunction, const wchar_t *szFile, unsigned int iLine, uintptr_t pReserved ) { FAIL_M( "Invalid parameter" ); //TODO: Make this more informative } -#endif ArchHooks_Win32::ArchHooks_Win32() { @@ -34,9 +32,7 @@ ArchHooks_Win32::ArchHooks_Win32() CrashHandler::CrashHandlerHandleArgs( g_argc, g_argv ); SetUnhandledExceptionFilter( CrashHandler::ExceptionHandler ); -#if _MSC_VER >= 1400 // VC8 _set_invalid_parameter_handler( InvalidParameterHandler ); -#endif /* Windows boosts priority on keyboard input, among other things. Disable that for * the main thread. */ diff --git a/src/archutils/Win32/CrashHandlerChild.cpp b/src/archutils/Win32/CrashHandlerChild.cpp index fda6982306..9d4463c41d 100644 --- a/src/archutils/Win32/CrashHandlerChild.cpp +++ b/src/archutils/Win32/CrashHandlerChild.cpp @@ -29,9 +29,7 @@ #include "RageFileDriverDeflate.h" #include "ver.h" -#if defined(_MSC_VER) #pragma comment(lib, "dbghelp.lib") -#endif // XXX: What happens when we *don't* have version info? Does that ever actually happen? #include "ver.h" diff --git a/src/archutils/Win32/GetFileInformation.cpp b/src/archutils/Win32/GetFileInformation.cpp index 9f3e3679c2..ce69c915ff 100644 --- a/src/archutils/Win32/GetFileInformation.cpp +++ b/src/archutils/Win32/GetFileInformation.cpp @@ -7,9 +7,7 @@ #include #include -#if defined(_MSC_VER) #pragma comment(lib, "version.lib") -#endif bool GetFileVersion( RString sFile, RString &sOut ) { diff --git a/src/archutils/Win32/USB.cpp b/src/archutils/Win32/USB.cpp index f233a446e2..ecd5f48ecb 100644 --- a/src/archutils/Win32/USB.cpp +++ b/src/archutils/Win32/USB.cpp @@ -4,10 +4,8 @@ #include "RageUtil.h" #include "archutils/Win32/ErrorStrings.h" -#if defined(_MSC_VER) #pragma comment(lib, "setupapi.lib") #pragma comment(lib, "hid.lib") -#endif extern "C" { #include "archutils/Win32/ddk/setupapi.h" diff --git a/src/archutils/Win32/arch_setup.h b/src/archutils/Win32/arch_setup.h index a309e7e4f5..a0b3463071 100644 --- a/src/archutils/Win32/arch_setup.h +++ b/src/archutils/Win32/arch_setup.h @@ -2,15 +2,9 @@ #define ARCH_SETUP_WINDOWS_H #define SUPPORT_OPENGL -#if defined(_MSC_VER) #define SUPPORT_D3D -#endif -#if defined(_MSC_VER) - -#if _MSC_VER == 1400 // VC8 specific warnings #pragma warning (disable : 4005) // macro redefinitions (ARRAYSIZE) -#endif /* The following warnings are disabled in all builds. @@ -62,8 +56,6 @@ C4355: 'this' : used in base member initializer list // If this isn't defined to 0, VC fails to define things like stat and alloca. #define __STDC__ 0 -#endif - #include // needs to be included before our fixes below #define lstat stat @@ -77,10 +69,8 @@ struct tm *my_localtime_r( const time_t *timep, struct tm *result ); #define localtime_r my_localtime_r struct tm *my_gmtime_r( const time_t *timep, struct tm *result ); #define gmtime_r my_gmtime_r -#if defined(_MSC_VER) void my_usleep( unsigned long usec ); #define usleep my_usleep -#endif // Missing stdint types: typedef signed char int8_t; @@ -94,20 +84,6 @@ typedef int int32_t; typedef unsigned int uint32_t; typedef __int64 int64_t; typedef unsigned __int64 uint64_t; -#if defined(_MSC_VER) -#if _MSC_VER < 1700 // 1700 = VC++ 2011 -#define INT64_C(i) i##i64 -#ifndef UINT64_C -#define UINT64_C(i) i##ui64 -#endif -#endif // #if _MSC_VER < 1700 -#if (_MSC_VER >= 1400) && (_MSC_VER < 1800) // 1800 = VC++ 2013 -#define llabs(i) _abs64(i) -#endif // #if (_MSC_VER >= 1400) && (_MSC_VER < 1800) -#if _MSC_VER < 1400 // 1400 = VC++ 2005 -int64_t llabs( int64_t i ) { return i >= 0 ? i : -i; } -#endif // #if _MSC_VER < 1400 -#endif // #if defined(_MSC_VER) #undef min #undef max @@ -119,7 +95,6 @@ int64_t llabs( int64_t i ) { return i >= 0 ? i : -i; } #define CRASH_HANDLER #endif -#if defined(_MSC_VER) && (_MSC_VER >= 1310) // Byte swap functions were first implemented in Visual Studio .NET 2003 #define ArchSwap32(n) _byteswap_ulong(n) #define ArchSwap24(n) _byteswap_ulong(n) >> 8 #define ArchSwap16(n) _byteswap_ushort(n) diff --git a/src/archutils/Win32/ddk/dbghelp.h b/src/archutils/Win32/ddk/dbghelp.h index b85c5c6b6c..6942b3249b 100644 --- a/src/archutils/Win32/ddk/dbghelp.h +++ b/src/archutils/Win32/ddk/dbghelp.h @@ -20,9 +20,7 @@ Revision History: #ifndef _DBGHELP_ #define _DBGHELP_ -#if _MSC_VER > 1020 #pragma once -#endif // As a general principal always call the 64 bit version @@ -46,7 +44,7 @@ extern "C" { #define DBHLP_DEPRECIATED #else #define IMAGEAPI DECLSPEC_IMPORT __stdcall - #if (_MSC_VER >= 1300) && !defined(MIDL_PASS) + #if !defined(MIDL_PASS) #define DBHLP_DEPRECIATED __declspec(deprecated) #else #define DBHLP_DEPRECIATED @@ -2044,14 +2042,8 @@ typedef enum _MINIDUMP_STREAM_TYPE { // Operating System specific information. // -#if defined(_MSC_VER) -#if _MSC_VER >= 800 -#if _MSC_VER >= 1200 #pragma warning(push) -#endif #pragma warning(disable:4201) /* Nameless struct/union */ -#endif -#endif typedef struct _MINIDUMP_SYSTEM_INFO { @@ -2161,15 +2153,7 @@ typedef struct _MINIDUMP_SYSTEM_INFO { typedef union _CPU_INFORMATION CPU_INFORMATION, *PCPU_INFORMATION; -#if defined(_MSC_VER) -#if _MSC_VER >= 800 -#if _MSC_VER >= 1200 #pragma warning(pop) -#else -#pragma warning(disable:4201) /* Nameless struct/union */ -#endif -#endif -#endif // // The minidump thread contains standard thread diff --git a/src/archutils/Win32/ddk/setupapi.h b/src/archutils/Win32/ddk/setupapi.h index d832be9568..1e4baeb917 100644 --- a/src/archutils/Win32/ddk/setupapi.h +++ b/src/archutils/Win32/ddk/setupapi.h @@ -15,9 +15,7 @@ Abstract: #ifndef _INC_SETUPAPI #define _INC_SETUPAPI -#if _MSC_VER > 1000 #pragma once -#endif // // Define API decoration for direct importing of DLL references. diff --git a/src/global.h b/src/global.h index c6baf2d190..a90bcf5eda 100644 --- a/src/global.h +++ b/src/global.h @@ -3,9 +3,9 @@ #include "config.hpp" -#if _MSC_VER >= 1000 +#if defined(_MSC_VER) #pragma once -#endif // _MSC_VER >= 1000 +#endif /** @brief This macro is for INT8_MIN, etc. */ #define __STDC_LIMIT_MACROS diff --git a/src/smpackage/ChangeGameSettings.h b/src/smpackage/ChangeGameSettings.h index aac51e1f71..dd74883fdc 100644 --- a/src/smpackage/ChangeGameSettings.h +++ b/src/smpackage/ChangeGameSettings.h @@ -1,9 +1,9 @@ #if !defined(AFX_CHANGEGAMESETTINGS_H__BFA59E6F_E70A_49A7_90A6_F04D3C321CA6__INCLUDED_) #define AFX_CHANGEGAMESETTINGS_H__BFA59E6F_E70A_49A7_90A6_F04D3C321CA6__INCLUDED_ -#if _MSC_VER > 1000 +#if defined(_MSC_VER) #pragma once -#endif // _MSC_VER > 1000 +#endif // ChangeGameSettings.h : header file // diff --git a/src/smpackage/EditInsallations.h b/src/smpackage/EditInsallations.h index 2acf892d73..299b3fc18c 100644 --- a/src/smpackage/EditInsallations.h +++ b/src/smpackage/EditInsallations.h @@ -1,9 +1,9 @@ #if !defined(AFX_EDITINSALLATIONS_H__CD328CB4_8E35_4B12_BCD1_ADF5CE7EABC7__INCLUDED_) #define AFX_EDITINSALLATIONS_H__CD328CB4_8E35_4B12_BCD1_ADF5CE7EABC7__INCLUDED_ -#if _MSC_VER > 1000 +#if defined(_MSC_VER) #pragma once -#endif // _MSC_VER > 1000 +#endif // EditInsallations.h : header file ///////////////////////////////////////////////////////////////////////////// diff --git a/src/smpackage/EnterComment.h b/src/smpackage/EnterComment.h index 9594390886..24b4547ad9 100644 --- a/src/smpackage/EnterComment.h +++ b/src/smpackage/EnterComment.h @@ -2,9 +2,9 @@ #if !defined(AFX_ENTERCOMMENT_H__DE628EA8_0FE7_4594_B2A2_47BDB283FA1E__INCLUDED_) #define AFX_ENTERCOMMENT_H__DE628EA8_0FE7_4594_B2A2_47BDB283FA1E__INCLUDED_ -#if _MSC_VER > 1000 +#if defined(_MSC_VER) #pragma once -#endif // _MSC_VER > 1000 +#endif // EnterComment.h : header file ///////////////////////////////////////////////////////////////////////////// diff --git a/src/smpackage/EnterName.h b/src/smpackage/EnterName.h index ea9c154829..570fff0279 100644 --- a/src/smpackage/EnterName.h +++ b/src/smpackage/EnterName.h @@ -1,9 +1,9 @@ #if !defined(AFX_ENTERNAME_H__0AB99274_EB79_4A25_B95C_627E0A99C6BA__INCLUDED_) #define AFX_ENTERNAME_H__0AB99274_EB79_4A25_B95C_627E0A99C6BA__INCLUDED_ -#if _MSC_VER > 1000 +#if defined(_MSC_VER) #pragma once -#endif // _MSC_VER > 1000 +#endif // EnterName.h : header file ///////////////////////////////////////////////////////////////////////////// diff --git a/src/smpackage/MainMenuDlg.h b/src/smpackage/MainMenuDlg.h index 992d00ec04..a3618bad23 100644 --- a/src/smpackage/MainMenuDlg.h +++ b/src/smpackage/MainMenuDlg.h @@ -1,9 +1,9 @@ #if !defined(AFX_MAINMENUDLG_H__3CED6142_18E5_4267_B678_BE5B63735C6C__INCLUDED_) #define AFX_MAINMENUDLG_H__3CED6142_18E5_4267_B678_BE5B63735C6C__INCLUDED_ -#if _MSC_VER > 1000 +#if defined(_MSC_VER) #pragma once -#endif // _MSC_VER > 1000 +#endif // MainMenuDlg.h : header file ///////////////////////////////////////////////////////////////////////////// diff --git a/src/smpackage/SMPackageInstallDlg.h b/src/smpackage/SMPackageInstallDlg.h index 017ab22703..3f9abffbc4 100644 --- a/src/smpackage/SMPackageInstallDlg.h +++ b/src/smpackage/SMPackageInstallDlg.h @@ -1,9 +1,9 @@ #if !defined(AFX_SMPACKAGEINSTALLDLG_H__5E362C4C_CA11_4071_A8AB_A0231E985DAF__INCLUDED_) #define AFX_SMPACKAGEINSTALLDLG_H__5E362C4C_CA11_4071_A8AB_A0231E985DAF__INCLUDED_ -#if _MSC_VER > 1000 +#if defined(_MSC_VER) #pragma once -#endif // _MSC_VER > 1000 +#endif // SMPackageInstallDlg.h : header file ///////////////////////////////////////////////////////////////////////////// diff --git a/src/smpackage/ShowComment.h b/src/smpackage/ShowComment.h index b08223ca95..89e8b06c62 100644 --- a/src/smpackage/ShowComment.h +++ b/src/smpackage/ShowComment.h @@ -1,9 +1,9 @@ #if !defined(AFX_SHOWCOMMENT_H__1FA603E3_5CCD_4D9E_9EC9_88AD55A06270__INCLUDED_) #define AFX_SHOWCOMMENT_H__1FA603E3_5CCD_4D9E_9EC9_88AD55A06270__INCLUDED_ -#if _MSC_VER > 1000 +#if defined(_MSC_VER) #pragma once -#endif // _MSC_VER > 1000 +#endif // ShowComment.h : header file ///////////////////////////////////////////////////////////////////////////// diff --git a/src/smpackage/SmpackageExportDlg.h b/src/smpackage/SmpackageExportDlg.h index 4c8a72902e..bf5aff5735 100644 --- a/src/smpackage/SmpackageExportDlg.h +++ b/src/smpackage/SmpackageExportDlg.h @@ -1,9 +1,9 @@ #if !defined(AFX_SMPACKAGEEXPORTDLG_H__3E19CBFB_E8F6_4C18_B0A4_636979B80A4D__INCLUDED_) #define AFX_SMPACKAGEEXPORTDLG_H__3E19CBFB_E8F6_4C18_B0A4_636979B80A4D__INCLUDED_ -#if _MSC_VER > 1000 +#if defined(_MSC_VER) #pragma once -#endif // _MSC_VER > 1000 +#endif #include "afxtempl.h" diff --git a/src/smpackage/StdAfx.h b/src/smpackage/StdAfx.h index a44f6667c9..6cc9991dd6 100644 --- a/src/smpackage/StdAfx.h +++ b/src/smpackage/StdAfx.h @@ -6,9 +6,9 @@ #if !defined(AFX_STDAFX_H__D450D5ED_5C49_4A8B_B887_076F62424F1F__INCLUDED_) #define AFX_STDAFX_H__D450D5ED_5C49_4A8B_B887_076F62424F1F__INCLUDED_ -#if _MSC_VER > 1000 +#if defined(_MSC_VER) #pragma once -#endif // _MSC_VER > 1000 +#endif #pragma warning (disable : 4786) // turn off broken debugger warning diff --git a/src/smpackage/TreeCtrlEx.h b/src/smpackage/TreeCtrlEx.h index 89d7f19ca2..4062ba7cb6 100644 --- a/src/smpackage/TreeCtrlEx.h +++ b/src/smpackage/TreeCtrlEx.h @@ -10,9 +10,9 @@ #if !defined(AFX_TREECTRLEX_H__5D969ED4_7DEA_4FB5_8C1D_E12D1CCF0989__INCLUDED_) #define AFX_TREECTRLEX_H__5D969ED4_7DEA_4FB5_8C1D_E12D1CCF0989__INCLUDED_ -#if _MSC_VER > 1000 +#if defined(_MSC_VER) #pragma once -#endif // _MSC_VER > 1000 +#endif #include diff --git a/src/smpackage/smpackage.h b/src/smpackage/smpackage.h index d43aed51e8..11c6d236b9 100644 --- a/src/smpackage/smpackage.h +++ b/src/smpackage/smpackage.h @@ -3,9 +3,9 @@ #if !defined(AFX_SMPACKAGE_H__FBCA9E6C_86A9_4271_8304_83CC34A31687__INCLUDED_) #define AFX_SMPACKAGE_H__FBCA9E6C_86A9_4271_8304_83CC34A31687__INCLUDED_ -#if _MSC_VER > 1000 +#if defined(_MSC_VER) #pragma once -#endif // _MSC_VER > 1000 +#endif #ifndef __AFXWIN_H__ #error include 'stdafx.h' before including this file for PCH