From bee6a20d1c7d807b5023d932ae179db1bc9a0f80 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 7 Feb 2021 17:56:58 -0600 Subject: Ignore enum CA warnings and scope the osutil deprecation suppression. Also, fix project reference so the .vcx project system understands it. --- src/Cpp.Build.props | 4 ++++ src/CustomizedNativeRecommendedRules.ruleset | 8 ++++++++ src/dutil/dutil.vcxproj | 5 +---- src/dutil/osutil.cpp | 7 +++++++ src/test/DUtilUnitTest/DUtilUnitTest.vcxproj | 4 +++- 5 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 src/CustomizedNativeRecommendedRules.ruleset diff --git a/src/Cpp.Build.props b/src/Cpp.Build.props index 44a042c7..fb805b42 100644 --- a/src/Cpp.Build.props +++ b/src/Cpp.Build.props @@ -12,6 +12,10 @@ $([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0')) + + $(MSBuildThisFileDirectory)CustomizedNativeRecommendedRules.ruleset + + $(DisableSpecificCompilerWarnings) diff --git a/src/CustomizedNativeRecommendedRules.ruleset b/src/CustomizedNativeRecommendedRules.ruleset new file mode 100644 index 00000000..142b141c --- /dev/null +++ b/src/CustomizedNativeRecommendedRules.ruleset @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/dutil/dutil.vcxproj b/src/dutil/dutil.vcxproj index 2cf99d13..b84fd80f 100644 --- a/src/dutil/dutil.vcxproj +++ b/src/dutil/dutil.vcxproj @@ -83,10 +83,7 @@ - - - 4996 - + diff --git a/src/dutil/osutil.cpp b/src/dutil/osutil.cpp index 38b32eb3..8834cd30 100644 --- a/src/dutil/osutil.cpp +++ b/src/dutil/osutil.cpp @@ -22,7 +22,14 @@ extern "C" void DAPI OsGetVersion( if (OS_VERSION_UNKNOWN == vOsVersion) { ovi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXW); + +#pragma warning (push) +#pragma warning(suppress: 4996) // deprecated +#pragma warning (push) +#pragma warning(suppress: 28159)// deprecated, use other function instead ::GetVersionExW(reinterpret_cast(&ovi)); // only fails if version info size is set incorrectly. +#pragma warning (pop) +#pragma warning (pop) vdwOsServicePack = static_cast(ovi.wServicePackMajor) << 16 | ovi.wServicePackMinor; if (4 == ovi.dwMajorVersion) diff --git a/src/test/DUtilUnitTest/DUtilUnitTest.vcxproj b/src/test/DUtilUnitTest/DUtilUnitTest.vcxproj index e1164aca..942c39f0 100644 --- a/src/test/DUtilUnitTest/DUtilUnitTest.vcxproj +++ b/src/test/DUtilUnitTest/DUtilUnitTest.vcxproj @@ -70,7 +70,9 @@ - + + {1244E671-F108-4334-BA52-8A7517F26ECD} + -- cgit v1.2.3-55-g6feb