From 05c1c618c390e8e7d0d3dc977524016dc6b2edef Mon Sep 17 00:00:00 2001 From: hvlad Date: Thu, 1 Dec 2016 13:11:16 +0200 Subject: [PATCH] Support for VC 2013 (MSVC12) --- builds/win32/make_boot.bat | 18 ++ builds/win32/msvc12/common.vcxproj | 10 +- builds/win32/msvc12/common.vcxproj.filters | 6 + extern/decNumber/.gitignore | 2 + extern/decNumber/msvc/decNumber_MSVC12.sln | 28 ++ .../decNumber/msvc/decNumber_MSVC12.vcxproj | 267 ++++++++++++++++++ src/common/DecFloat.cpp | 2 +- src/include/gen/autoconfig_msvc.h | 13 + 8 files changed, 341 insertions(+), 5 deletions(-) create mode 100644 extern/decNumber/.gitignore create mode 100644 extern/decNumber/msvc/decNumber_MSVC12.sln create mode 100644 extern/decNumber/msvc/decNumber_MSVC12.vcxproj diff --git a/builds/win32/make_boot.bat b/builds/win32/make_boot.bat index 88b5bbd925..6950ca19b5 100644 --- a/builds/win32/make_boot.bat +++ b/builds/win32/make_boot.bat @@ -38,6 +38,9 @@ if "%ERRLEV%"=="1" goto :END call :LibTomMath if "%ERRLEV%"=="1" goto :END +call :decNumber +if "%ERRLEV%"=="1" goto :END + call :zlib if "%ERRLEV%"=="1" goto :END @@ -133,6 +136,21 @@ if errorlevel 1 call :boot2 libtommath_%FB_OBJ_DIR% @call set_build_target.bat %* goto :EOF +::=================== +:: BUILD decNumber +:decNumber +@echo. +@call set_build_target.bat %* RELEASE +@echo Building decNumber (%FB_OBJ_DIR%)... +@call compile.bat %FB_ROOT_PATH%\extern\decNumber\msvc\decNumber_MSVC%MSVC_VERSION% decNumber_%FB_OBJ_DIR%_%FB_TARGET_PLATFORM%.log decNumber +if errorlevel 1 call :boot2 decNumber_%FB_OBJ_DIR% +@call set_build_target.bat %* DEBUG +@echo Building decNumber (%FB_OBJ_DIR%)... +@call compile.bat %FB_ROOT_PATH%\extern\decNumber\msvc\decNumber_MSVC%MSVC_VERSION% decNumber_%FB_OBJ_DIR%_%FB_TARGET_PLATFORM%.log decNumber +if errorlevel 1 call :boot2 decNumber_%FB_OBJ_DIR% +@call set_build_target.bat %* +goto :EOF + ::=================== :: Extract zlib :zlib diff --git a/builds/win32/msvc12/common.vcxproj b/builds/win32/msvc12/common.vcxproj index 89d9da898e..7fe6f7c086 100644 --- a/builds/win32/msvc12/common.vcxproj +++ b/builds/win32/msvc12/common.vcxproj @@ -58,6 +58,7 @@ + @@ -154,6 +155,7 @@ + @@ -283,7 +285,7 @@ 0x041d - ws2_32.lib;../../../extern/libtommath/lib/$(PlatformName)\Release\tommath.lib;%(AdditionalDependencies) + ws2_32.lib;../../../extern/libtommath/lib/$(PlatformName)\$(Configuration)\tommath.lib;../../../extern/decNumber/lib/$(PlatformName)\$(Configuration)\decnumber.lib;%(AdditionalDependencies) @@ -299,7 +301,7 @@ 0x041d - ws2_32.lib;../../../extern/libtommath/lib/$(PlatformName)\Debug\tommath.lib;%(AdditionalDependencies) + ws2_32.lib;../../../extern/libtommath/lib/$(PlatformName)\$(Configuration)\tommath.lib;../../../extern/decNumber/lib/$(PlatformName)\$(Configuration)\decnumber.lib;%(AdditionalDependencies) @@ -318,7 +320,7 @@ 0x041d - ws2_32.lib;../../../extern/libtommath/lib/$(PlatformName)\Release\tommath.lib;%(AdditionalDependencies) + ws2_32.lib;../../../extern/libtommath/lib/$(PlatformName)\$(Configuration)\tommath.lib;../../../extern/decNumber/lib/$(PlatformName)\$(Configuration)\decnumber.lib;%(AdditionalDependencies) @@ -336,7 +338,7 @@ 0x041d - ws2_32.lib;../../../extern/libtommath/lib/$(PlatformName)\Debug\tommath.lib;%(AdditionalDependencies) + ws2_32.lib;../../../extern/libtommath/lib/$(PlatformName)\$(Configuration)\tommath.lib;../../../extern/decNumber/lib/$(PlatformName)\$(Configuration)\decnumber.lib;%(AdditionalDependencies) diff --git a/builds/win32/msvc12/common.vcxproj.filters b/builds/win32/msvc12/common.vcxproj.filters index fb87986102..8fec78de3a 100644 --- a/builds/win32/msvc12/common.vcxproj.filters +++ b/builds/win32/msvc12/common.vcxproj.filters @@ -216,6 +216,9 @@ common + + classes + @@ -530,5 +533,8 @@ headers + + headers + \ No newline at end of file diff --git a/extern/decNumber/.gitignore b/extern/decNumber/.gitignore new file mode 100644 index 0000000000..ac8f109172 --- /dev/null +++ b/extern/decNumber/.gitignore @@ -0,0 +1,2 @@ +temp/ +lib/ diff --git a/extern/decNumber/msvc/decNumber_MSVC12.sln b/extern/decNumber/msvc/decNumber_MSVC12.sln new file mode 100644 index 0000000000..e12432872c --- /dev/null +++ b/extern/decNumber/msvc/decNumber_MSVC12.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.31101.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "decNumber", "decNumber_MSVC12.vcxproj", "{BE4D2DDC-59A0-4CD7-848E-231E13785335}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BE4D2DDC-59A0-4CD7-848E-231E13785335}.Debug|Win32.ActiveCfg = Debug|Win32 + {BE4D2DDC-59A0-4CD7-848E-231E13785335}.Debug|Win32.Build.0 = Debug|Win32 + {BE4D2DDC-59A0-4CD7-848E-231E13785335}.Debug|x64.ActiveCfg = Debug|x64 + {BE4D2DDC-59A0-4CD7-848E-231E13785335}.Debug|x64.Build.0 = Debug|x64 + {BE4D2DDC-59A0-4CD7-848E-231E13785335}.Release|Win32.ActiveCfg = Release|Win32 + {BE4D2DDC-59A0-4CD7-848E-231E13785335}.Release|Win32.Build.0 = Release|Win32 + {BE4D2DDC-59A0-4CD7-848E-231E13785335}.Release|x64.ActiveCfg = Release|x64 + {BE4D2DDC-59A0-4CD7-848E-231E13785335}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/extern/decNumber/msvc/decNumber_MSVC12.vcxproj b/extern/decNumber/msvc/decNumber_MSVC12.vcxproj new file mode 100644 index 0000000000..b562e03f55 --- /dev/null +++ b/extern/decNumber/msvc/decNumber_MSVC12.vcxproj @@ -0,0 +1,267 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + + true + true + true + true + + + true + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + decNumber + {BE4D2DDC-59A0-4CD7-848E-231E13785335} + decNumber + + + + StaticLibrary + false + MultiByte + v120_xp + + + StaticLibrary + false + MultiByte + v120 + + + StaticLibrary + false + MultiByte + v120_xp + + + StaticLibrary + false + MultiByte + v120 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + ..\lib\$(Platform)\$(Configuration)\ + ..\lib\$(Platform)\$(Configuration)\ + ..\temp\$(Platform)\$(Configuration)\ + ..\temp\$(Platform)\$(Configuration)\ + ..\lib\$(Platform)\$(Configuration)\ + ..\lib\$(Platform)\$(Configuration)\ + ..\temp\$(Platform)\$(Configuration)\ + ..\temp\$(Platform)\$(Configuration)\ + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + decnumber + decnumber + decnumber + decnumber + + + + Disabled + .;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + EditAndContinue + + + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)\$(TargetFileName) + true + + + true + .\Debug/libtommath.bsc + + + + + Disabled + .;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + + + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)\$(TargetFileName) + true + + + true + .\Debug/libtommath.bsc + + + + + MaxSpeed + OnlyExplicitInline + .;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + + + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)\$(TargetFileName) + true + + + true + .\Release/libtommath.bsc + + + + + MaxSpeed + OnlyExplicitInline + .;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + + + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)\$(TargetFileName) + true + + + true + .\Release/libtommath.bsc + + + + + + \ No newline at end of file diff --git a/src/common/DecFloat.cpp b/src/common/DecFloat.cpp index c5981c6fb1..b6dc12bf67 100644 --- a/src/common/DecFloat.cpp +++ b/src/common/DecFloat.cpp @@ -62,7 +62,7 @@ public: init(DEC_INIT_DECIMAL128); } - ~DecimalContext() noexcept(false) + ~DecimalContext() NOEXCEPT_ARG(false) { // Typically excptions should better be not thrown from destructors. // But in our case there should never be any exception raised inside diff --git a/src/include/gen/autoconfig_msvc.h b/src/include/gen/autoconfig_msvc.h index 81ef61a6b7..25c2962c7f 100644 --- a/src/include/gen/autoconfig_msvc.h +++ b/src/include/gen/autoconfig_msvc.h @@ -207,6 +207,19 @@ #define isnan _isnan #endif +#if !defined(HAS_NOEXCEPT) +#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026 +#define HAS_NOEXCEPT +#endif +#endif + +#ifdef HAS_NOEXCEPT +#define NOEXCEPT noexcept +#define NOEXCEPT_ARG(X) noexcept((X)) +#else +#define NOEXCEPT +#define NOEXCEPT_ARG(X) +#endif /* Types */ #undef HAVE_SOCKLEN_T