From d162d9371c53e34df9b5ffd52bdecedd1216df42 Mon Sep 17 00:00:00 2001 From: mosfet80 Date: Tue, 28 Jun 2022 01:42:33 +0300 Subject: [PATCH] Remove old msc ver. Freecad 0.20 require 64 bit and windows 7 or higher. For this reason, msc libraries less than 1800 will no longer be used. (#7036) * remove msc<1800 --- src/Base/Builder3D.cpp | 3 - src/Base/MemDebug.cpp | 10 +- src/Base/StackWalker.cpp | 140 +-------------------- src/Base/StackWalker.h | 17 --- src/CXX/Python3/Config.hxx | 9 +- src/Main/MainGui.cpp | 5 - src/Mod/Drawing/Gui/TaskOrthoViews.cpp | 7 +- src/Mod/Fem/App/FemConstraint.cpp | 7 +- src/Mod/Mesh/App/WildMagic4/Wm4Platforms.h | 11 +- src/Tools/thumbs/StdAfx.h | 2 - 10 files changed, 10 insertions(+), 201 deletions(-) diff --git a/src/Base/Builder3D.cpp b/src/Base/Builder3D.cpp index 3e698c6dd9..7aa4ecacd9 100644 --- a/src/Base/Builder3D.cpp +++ b/src/Base/Builder3D.cpp @@ -172,10 +172,7 @@ void Builder3D::addText(const Base::Vector3f &vec,const char * text, float color void Builder3D::clear () { - // Under VC6 string::clear() doesn't exist, under gcc stringstream::str() returns a copy not a reference -#if defined(_MSC_VER) && _MSC_VER >= 1400 result.str().clear(); -#endif result.clear(); } diff --git a/src/Base/MemDebug.cpp b/src/Base/MemDebug.cpp index a09ed147be..532d7f71de 100644 --- a/src/Base/MemDebug.cpp +++ b/src/Base/MemDebug.cpp @@ -122,19 +122,13 @@ MemDebug::MemDebug() // Open a log file for the hook functions to use if ( logFile != NULL ) throw std::runtime_error("Base::MemDebug::MemDebug():38: Don't call the constructor by your self!"); -#if (_MSC_VER >= 1400) + fopen_s( &logFile, "MemLog.txt", "w" ); if ( logFile == NULL ) throw std::runtime_error("Base::MemDebug::MemDebug():41: File IO Error. Can't open log file..."); _strtime_s( timeStr, 15 ); _strdate_s( dateStr, 15 ); -#elif (_MSC_VER >= 1200) - logFile = fopen( "MemLog.txt", "w" ); - if ( logFile == NULL ) - throw std::runtime_error("Base::MemDebug::MemDebug():41: File IO Error. Can't open log file..."); - _strtime( timeStr ); - _strdate( dateStr ); -#endif + fprintf( logFile, "Memory Allocation Log File for FreeCAD, run at %s on %s.\n", timeStr, dateStr ); diff --git a/src/Base/StackWalker.cpp b/src/Base/StackWalker.cpp index cd8f60b6a7..d3dec4cc16 100644 --- a/src/Base/StackWalker.cpp +++ b/src/Base/StackWalker.cpp @@ -94,135 +94,9 @@ // If VC7 and later, then use the shipped 'dbghelp.h'-file #pragma pack(push,8) -#if _MSC_VER >= 1300 + #include -#else -// inline the important dbghelp.h-declarations... -typedef enum { - SymNone = 0, - SymCoff, - SymCv, - SymPdb, - SymExport, - SymDeferred, - SymSym, - SymDia, - SymVirtual, - NumSymTypes -} SYM_TYPE; -typedef struct _IMAGEHLP_LINE64 { - DWORD SizeOfStruct; // set to sizeof(IMAGEHLP_LINE64) - PVOID Key; // internal - DWORD LineNumber; // line number in file - PCHAR FileName; // full filename - DWORD64 Address; // first instruction of line -} IMAGEHLP_LINE64, *PIMAGEHLP_LINE64; -typedef struct _IMAGEHLP_MODULE64 { - DWORD SizeOfStruct; // set to sizeof(IMAGEHLP_MODULE64) - DWORD64 BaseOfImage; // base load address of module - DWORD ImageSize; // virtual size of the loaded module - DWORD TimeDateStamp; // date/time stamp from pe header - DWORD CheckSum; // checksum from the pe header - DWORD NumSyms; // number of symbols in the symbol table - SYM_TYPE SymType; // type of symbols loaded - CHAR ModuleName[32]; // module name - CHAR ImageName[256]; // image name - CHAR LoadedImageName[256]; // symbol file name -} IMAGEHLP_MODULE64, *PIMAGEHLP_MODULE64; -typedef struct _IMAGEHLP_SYMBOL64 { - DWORD SizeOfStruct; // set to sizeof(IMAGEHLP_SYMBOL64) - DWORD64 Address; // virtual address including dll base address - DWORD Size; // estimated size of symbol, can be zero - DWORD Flags; // info about the symbols, see the SYMF defines - DWORD MaxNameLength; // maximum size of symbol name in 'Name' - CHAR Name[1]; // symbol name (null terminated string) -} IMAGEHLP_SYMBOL64, *PIMAGEHLP_SYMBOL64; -typedef enum { - AddrMode1616, - AddrMode1632, - AddrModeReal, - AddrModeFlat -} ADDRESS_MODE; -typedef struct _tagADDRESS64 { - DWORD64 Offset; - WORD Segment; - ADDRESS_MODE Mode; -} ADDRESS64, *LPADDRESS64; -typedef struct _KDHELP64 { - DWORD64 Thread; - DWORD ThCallbackStack; - DWORD ThCallbackBStore; - DWORD NextCallback; - DWORD FramePointer; - DWORD64 KiCallUserMode; - DWORD64 KeUserCallbackDispatcher; - DWORD64 SystemRangeStart; - DWORD64 Reserved[8]; -} KDHELP64, *PKDHELP64; -typedef struct _tagSTACKFRAME64 { - ADDRESS64 AddrPC; // program counter - ADDRESS64 AddrReturn; // return address - ADDRESS64 AddrFrame; // frame pointer - ADDRESS64 AddrStack; // stack pointer - ADDRESS64 AddrBStore; // backing store pointer - PVOID FuncTableEntry; // pointer to pdata/fpo or NULL - DWORD64 Params[4]; // possible arguments to the function - BOOL Far; // WOW far call - BOOL Virtual; // is this a virtual frame? - DWORD64 Reserved[3]; - KDHELP64 KdHelp; -} STACKFRAME64, *LPSTACKFRAME64; -typedef -BOOL -(__stdcall *PREAD_PROCESS_MEMORY_ROUTINE64)( - HANDLE hProcess, - DWORD64 qwBaseAddress, - PVOID lpBuffer, - DWORD nSize, - LPDWORD lpNumberOfBytesRead - ); -typedef -PVOID -(__stdcall *PFUNCTION_TABLE_ACCESS_ROUTINE64)( - HANDLE hProcess, - DWORD64 AddrBase - ); -typedef -DWORD64 -(__stdcall *PGET_MODULE_BASE_ROUTINE64)( - HANDLE hProcess, - DWORD64 Address - ); -typedef -DWORD64 -(__stdcall *PTRANSLATE_ADDRESS_ROUTINE64)( - HANDLE hProcess, - HANDLE hThread, - LPADDRESS64 lpaddr - ); -#define SYMOPT_CASE_INSENSITIVE 0x00000001 -#define SYMOPT_UNDNAME 0x00000002 -#define SYMOPT_DEFERRED_LOADS 0x00000004 -#define SYMOPT_NO_CPP 0x00000008 -#define SYMOPT_LOAD_LINES 0x00000010 -#define SYMOPT_OMAP_FIND_NEAREST 0x00000020 -#define SYMOPT_LOAD_ANYTHING 0x00000040 -#define SYMOPT_IGNORE_CVREC 0x00000080 -#define SYMOPT_NO_UNQUALIFIED_LOADS 0x00000100 -#define SYMOPT_FAIL_CRITICAL_ERRORS 0x00000200 -#define SYMOPT_EXACT_SYMBOLS 0x00000400 -#define SYMOPT_ALLOW_ABSOLUTE_SYMBOLS 0x00000800 -#define SYMOPT_IGNORE_NT_SYMPATH 0x00001000 -#define SYMOPT_INCLUDE_32BIT_MODULES 0x00002000 -#define SYMOPT_PUBLICS_ONLY 0x00004000 -#define SYMOPT_NO_PUBLICS 0x00008000 -#define SYMOPT_AUTO_PUBLICS 0x00010000 -#define SYMOPT_NO_IMAGE_SEARCH 0x00020000 -#define SYMOPT_SECURE 0x00040000 -#define SYMOPT_DEBUG 0x80000000 -#define UNDNAME_COMPLETE (0x0000) // Enable full undecoration -#define UNDNAME_NAME_ONLY (0x1000) // Crack only the name for primary declaration; -#endif // _MSC_VER < 1300 + #pragma pack(pop) // Some missing defines (for VC5/6): @@ -231,15 +105,6 @@ DWORD64 #endif -// secure-CRT_functions are only available starting with VC8 -#if _MSC_VER < 1400 -#define strcpy_s(dst, len, src) strcpy(dst, src) -#define strncpy_s(dst, len, src, maxLen) strncpy(dst, len, src) -#define strcat_s(dst, len, src) strcat(dst, src) -#define _snprintf_s _snprintf -#define _tcscat_s _tcscat -#endif - static void MyStrCpy(char* szDest, size_t nMaxDestSize, const char* szSrc) { if (nMaxDestSize <= 0) @@ -1349,7 +1214,6 @@ void StackWalker::OnSymInit(LPCSTR szSearchPath, DWORD symOptions, LPCSTR szUser ver.szCSDVersion, ver.wSuiteMask, ver.wProductType); OnOutput(buffer); } -#endif } void StackWalker::OnOutput(LPCSTR buffer) diff --git a/src/Base/StackWalker.h b/src/Base/StackWalker.h index 92efba154a..bb54bf7d9f 100644 --- a/src/Base/StackWalker.h +++ b/src/Base/StackWalker.h @@ -39,15 +39,6 @@ #include #endif -// special defines for VC5/6 (if no actual PSDK is installed): -#if _MSC_VER < 1300 -typedef unsigned __int64 DWORD64, *PDWORD64; -#if defined(_WIN64) -typedef unsigned __int64 SIZE_T, *PSIZE_T; -#else -typedef unsigned long SIZE_T, *PSIZE_T; -#endif -#endif // _MSC_VER < 1300 class StackWalkerInternal; // forward class BaseExport StackWalker @@ -114,11 +105,6 @@ public: LPVOID pUserData = NULL // optional to identify some data in the 'readMemoryFunction'-callback ); -#if _MSC_VER >= 1300 -// due to some reasons, the "STACKWALK_MAX_NAMELEN" must be declared as "public" -// in older compilers in order to use it... starting with VC7 we can declare it as "protected" -protected: -#endif enum { STACKWALK_MAX_NAMELEN = 1024 }; // max name length for found symbols protected: @@ -170,9 +156,6 @@ protected: // So we just use the compiler-version (and assumes that the PSDK is // the one which was installed by the VS-IDE) -// INFO: If you want, you can use the RtlCaptureContext if you only target XP and later... -// But I currently use it in x64/IA64 environments... -//#if defined(_M_IX86) && (_WIN32_WINNT <= 0x0500) && (_MSC_VER < 1400) #if defined(_M_IX86) #ifdef CURRENT_THREAD_VIA_EXCEPTION diff --git a/src/CXX/Python3/Config.hxx b/src/CXX/Python3/Config.hxx index a181b42d9a..339e847f2d 100644 --- a/src/CXX/Python3/Config.hxx +++ b/src/CXX/Python3/Config.hxx @@ -71,16 +71,11 @@ // Which C++ standard is in use? // #if defined( _MSC_VER ) -# if _MSC_VER <= 1200 -// MSVC++ 6.0 -# define PYCXX_ISO_CPP_LIB 0 -# define STR_STREAM -# define TEMPLATE_TYPENAME class -# else + # define PYCXX_ISO_CPP_LIB 1 # define STR_STREAM # define TEMPLATE_TYPENAME typename -# endif + #elif defined( __GNUC__ ) # if __GNUC__ >= 3 # define PYCXX_ISO_CPP_LIB 1 diff --git a/src/Main/MainGui.cpp b/src/Main/MainGui.cpp index b0699a4711..3216960f08 100644 --- a/src/Main/MainGui.cpp +++ b/src/Main/MainGui.cpp @@ -160,11 +160,6 @@ int main( int argc, char ** argv ) } #endif -#if defined(_MSC_VER) && _MSC_VER <= 1800 - // See InterpreterSingleton::init - Redirection out(stdout), err(stderr), inp(stdin); -#endif - // Name and Version of the Application App::Application::Config()["ExeName"] = "FreeCAD"; App::Application::Config()["ExeVendor"] = "FreeCAD"; diff --git a/src/Mod/Drawing/Gui/TaskOrthoViews.cpp b/src/Mod/Drawing/Gui/TaskOrthoViews.cpp index 7e9230dcdd..87b3d7fa0b 100644 --- a/src/Mod/Drawing/Gui/TaskOrthoViews.cpp +++ b/src/Mod/Drawing/Gui/TaskOrthoViews.cpp @@ -51,12 +51,7 @@ namespace bp = boost::placeholders; #endif -#if _MSC_VER <= 1700 -// maybe in the c++ standard later, older compiler don't have round() -double round(double r) { - return (r > 0.0) ? floor(r + 0.5) : ceil(r - 0.5); -} -#endif // _MSC_VER < 1500 + void pagesize(string & page_template, int dims[4], int block[4]) { diff --git a/src/Mod/Fem/App/FemConstraint.cpp b/src/Mod/Fem/App/FemConstraint.cpp index 98ecdd52ca..7b796696e3 100644 --- a/src/Mod/Fem/App/FemConstraint.cpp +++ b/src/Mod/Fem/App/FemConstraint.cpp @@ -70,12 +70,7 @@ using namespace Fem; -// maybe in the c++ standard later, older compiler don't have round() -#if _MSC_VER <= 1700 -double round(double r) { - return (r > 0.0) ? floor(r + 0.5) : ceil(r - 0.5); -} -#endif + #if OCC_VERSION_HEX >= 0x070600 using Adaptor3d_HSurface = Adaptor3d_Surface; diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4Platforms.h b/src/Mod/Mesh/App/WildMagic4/Wm4Platforms.h index 19ee26d10a..8f348eeacd 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4Platforms.h +++ b/src/Mod/Mesh/App/WildMagic4/Wm4Platforms.h @@ -60,15 +60,8 @@ typedef long long Integer64; #if defined(_MSC_VER) -// Microsoft Visual C++ specific pragmas. MSVC6 is version 12.00, MSVC7.0 is -// version 13.00, and MSVC7.1 is version 13.10. MSVC8.0 is version 14.00. -#if _MSC_VER < 1300 -#define WM4_USING_VC6 -#elif _MSC_VER < 1310 -#define WM4_USING_VC70 -#elif _MSC_VER < 1400 -#define WM4_USING_VC71 -#else +// Microsoft Visual C++ specific pragmas. +#if _MSC_VER #define WM4_USING_VC80 #endif diff --git a/src/Tools/thumbs/StdAfx.h b/src/Tools/thumbs/StdAfx.h index cf6dd550b6..acbd782847 100644 --- a/src/Tools/thumbs/StdAfx.h +++ b/src/Tools/thumbs/StdAfx.h @@ -28,9 +28,7 @@ #if !defined(AFX_STDAFX_H__BA56C57E_75FC_4E34_A374_AEA259EB50FA__INCLUDED_) #define AFX_STDAFX_H__BA56C57E_75FC_4E34_A374_AEA259EB50FA__INCLUDED_ -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 // Disable warnings #pragma warning(disable : 4996)