diff --git a/Test/pch.h b/Test/pch.h index 51d487976..91f12e846 100644 --- a/Test/pch.h +++ b/Test/pch.h @@ -45,37 +45,11 @@ #pragma warning(push) #pragma warning(disable: 5220) // '...': a non - static data member with a volatile qualified type no longer implies #pragma warning(disable: 5204) // 'Concurrency::details::_DefaultPPLTaskScheduler': class has virtual functions, but its trivial destructor is not virtual; instances of objects derived from this class may not be destructed correctly -#include -#include -#define _USE_MATH_DEFINES -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#include "six/modules/c++/cpp_pch.h" #include -#include -#undef min -#undef max #pragma warning(pop) #include @@ -100,6 +74,10 @@ #include #include +#include +#include +#include +#include #pragma comment(lib, "ws2_32") diff --git a/Test/six.sidd_test_read_sidd_legend.cpp b/Test/six.sidd_test_read_sidd_legend.cpp index a4c4b7731..5ac929c80 100644 --- a/Test/six.sidd_test_read_sidd_legend.cpp +++ b/Test/six.sidd_test_read_sidd_legend.cpp @@ -1,13 +1,105 @@ #include "pch.h" +#include + #include "sidd_Test.h" +namespace fs = std::filesystem; + +static bool is_x64_Configuration(const fs::path& path) // "Configuration" is typically "Debug" or "Release" +{ + const std::string build_configuration = +#if defined(NDEBUG) // i.e., release + "Release"; +#else + "Debug"; +#endif + + const auto Configuration = path.filename(); + const auto path_parent_path = path.parent_path(); + const auto x64 = path_parent_path.filename(); + return (Configuration == build_configuration) && (x64 == "x64"); +} + +static bool is_install_unittests(const fs::path& path) +{ + const auto unittests = path.filename(); + const auto path_parent_path = path.parent_path(); + const auto install = path_parent_path.filename(); + return (unittests == "unittests") && (install == "install"); +} +static bool is_install_tests(const fs::path& path) +{ + const auto tests = path.filename(); + const auto path_parent_path = path.parent_path(); + const auto install = path_parent_path.filename(); + return (tests == "tests") && (install == "install"); +} + +static fs::path buildSchemaDir() +{ + const auto cwd = fs::current_path(); + + const sys::OS os; + const auto exec = fs::path(os.getCurrentExecutable()); + const auto argv0 = exec.filename(); + if (argv0 == "Test.exe") + { + // Running GTest unit-tests in Visual Studio on Windows + if (is_x64_Configuration(cwd)) + { + const auto root_path = cwd.parent_path().parent_path(); + return root_path / "six" / "modules" / "c++" / "six.sidd" / "conf" / "schema"; + } + } + + if (argv0 == "unittests.exe") + { + // stand-alone unittest executable on Windows (ends in .EXE) + const auto parent_path = exec.parent_path(); + if (is_x64_Configuration(parent_path)) + { + const auto parent_path_ = parent_path.parent_path().parent_path(); + return parent_path_ / "dev" / "tests" / "images"; + } + } + + // stand-alone unit-test on Linux + const auto exec_dir = exec.parent_path(); + if (is_install_unittests(exec_dir)) + { + const auto install = exec_dir.parent_path(); + return install / "unittests" / "data"; + } + if (is_install_tests(exec_dir)) + { + const auto install = exec_dir.parent_path(); + return install / "unittests" / "data"; + } + + if (argv0 == "unittests") + { + // stand-alone unittest executable on Linux + const auto bin = exec.parent_path(); + if (bin.filename() == "bin") + { + const auto unittests = bin.parent_path(); + return unittests / "unittests" / "data"; + } + } + + //fprintf(stderr, "cwd = %s\n", cwd.c_str()); + //fprintf(stderr, "exec = %s\n", exec.c_str()); + + return cwd; +} + struct sidd_test_read_sidd_legend : public ::testing::Test { sidd_test_read_sidd_legend() { // initialization code here - const std::string SIX_SCHEMA_PATH = R"(C:\Users\jdsmith\source\repos\six\six\modules\c++\six.sidd\conf\schema)"; - const std::string putenv_ = "SIX_SCHEMA_PATH=" + SIX_SCHEMA_PATH; - + //const std::string SIX_SCHEMA_PATH = R"(C:\Users\jdsmith\source\repos\six\six\modules\c++\six.sidd\conf\schema)"; + const auto SIX_SCHEMA_PATH = buildSchemaDir(); + const std::string putenv_ = "SIX_SCHEMA_PATH=" + SIX_SCHEMA_PATH.string(); _putenv(putenv_.c_str()); } diff --git a/six.sln b/six.sln index 9779b0291..deeca5a40 100644 --- a/six.sln +++ b/six.sln @@ -25,6 +25,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test", "Test\Test.vcxproj", EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XML_DATA_CONTENT", "externals\nitro\modules\c\nitf\XML_DATA_CONTENT.vcxproj", "{78849481-D356-4CC7-B182-31C21F857ED1}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3AD152C2-1F3D-4108-826C-79BA5011874F}" + ProjectSection(SolutionItems) = preProject + six\modules\c++\cpp_pch.h = six\modules\c++\cpp_pch.h + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "check_valid_six", "six\modules\c++\samples\check_valid_six\check_valid_six.vcxproj", "{F0E2C8FF-57D4-4331-9BD2-76FF01CB54EB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -101,6 +108,14 @@ Global {78849481-D356-4CC7-B182-31C21F857ED1}.Release|x64.ActiveCfg = Release|x64 {78849481-D356-4CC7-B182-31C21F857ED1}.Release|x64.Build.0 = Release|x64 {78849481-D356-4CC7-B182-31C21F857ED1}.Release|x86.ActiveCfg = Release|x64 + {F0E2C8FF-57D4-4331-9BD2-76FF01CB54EB}.Debug|x64.ActiveCfg = Debug|x64 + {F0E2C8FF-57D4-4331-9BD2-76FF01CB54EB}.Debug|x64.Build.0 = Debug|x64 + {F0E2C8FF-57D4-4331-9BD2-76FF01CB54EB}.Debug|x86.ActiveCfg = Debug|Win32 + {F0E2C8FF-57D4-4331-9BD2-76FF01CB54EB}.Debug|x86.Build.0 = Debug|Win32 + {F0E2C8FF-57D4-4331-9BD2-76FF01CB54EB}.Release|x64.ActiveCfg = Release|x64 + {F0E2C8FF-57D4-4331-9BD2-76FF01CB54EB}.Release|x64.Build.0 = Release|x64 + {F0E2C8FF-57D4-4331-9BD2-76FF01CB54EB}.Release|x86.ActiveCfg = Release|Win32 + {F0E2C8FF-57D4-4331-9BD2-76FF01CB54EB}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/six/modules/c++/cphd/framework.h b/six/modules/c++/cphd/framework.h index 5f3700684..4922b6e62 100644 --- a/six/modules/c++/cphd/framework.h +++ b/six/modules/c++/cphd/framework.h @@ -42,37 +42,11 @@ #pragma warning(push) #pragma warning(disable: 5220) // '...': a non - static data member with a volatile qualified type no longer implies #pragma warning(disable: 5204) // 'Concurrency::details::_DefaultPPLTaskScheduler': class has virtual functions, but its trivial destructor is not virtual; instances of objects derived from this class may not be destructed correctly -#include -#include -#define _USE_MATH_DEFINES -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#include "../../cpp_pch.h" #include -#include -#undef min -#undef max #pragma warning(pop) #include diff --git a/six/modules/c++/cphd03/framework.h b/six/modules/c++/cphd03/framework.h index 4ef9eb856..51faf4911 100644 --- a/six/modules/c++/cphd03/framework.h +++ b/six/modules/c++/cphd03/framework.h @@ -42,37 +42,11 @@ #pragma warning(push) #pragma warning(disable: 5220) // '...': a non - static data member with a volatile qualified type no longer implies #pragma warning(disable: 5204) // 'Concurrency::details::_DefaultPPLTaskScheduler': class has virtual functions, but its trivial destructor is not virtual; instances of objects derived from this class may not be destructed correctly -#include -#include -#define _USE_MATH_DEFINES -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#include "../../cpp_pch.h" #include -#include -#undef min -#undef max #pragma warning(pop) #include diff --git a/six/modules/c++/cpp_pch.h b/six/modules/c++/cpp_pch.h new file mode 100644 index 000000000..f50e8399e --- /dev/null +++ b/six/modules/c++/cpp_pch.h @@ -0,0 +1,38 @@ +#pragma once + +#pragma warning(push) +#pragma warning(disable: 5220) // '...': a non - static data member with a volatile qualified type no longer implies +#pragma warning(disable: 5204) // 'Concurrency::details::_DefaultPPLTaskScheduler': class has virtual functions, but its trivial destructor is not virtual; instances of objects derived from this class may not be destructed correctly +#include +#include +#define _USE_MATH_DEFINES +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#undef min +#undef max +#pragma warning(pop) \ No newline at end of file diff --git a/six/modules/c++/samples/check_valid_six.cpp b/six/modules/c++/samples/check_valid_six.cpp index 281db1d5e..c2d549ddf 100644 --- a/six/modules/c++/samples/check_valid_six.cpp +++ b/six/modules/c++/samples/check_valid_six.cpp @@ -112,117 +112,169 @@ bool runValidation(const std::unique_ptr& data, } } -int main(int argc, char** argv) +// make it a little easier to use from MSVC +#if defined(_DEBUG) && defined(_MSC_VER) +#include +namespace fs = std::filesystem; + +static fs::path getNitfPath() { - try + const auto cwd = fs::current_path(); + const auto root_dir = cwd.parent_path().parent_path(); + return root_dir / "six" / "tests" / "nitf" / "sicd_1.1.0.nitf"; +} + +static void setNitfPluginPath() +{ + const auto cwd = fs::current_path(); + const auto root_dir = cwd.parent_path().parent_path().parent_path().parent_path().parent_path(); + + const std::string configuration = +#if defined(NDEBUG) // i.e., release + "Release"; +#else + "Debug"; +#endif + const std::string platform = "x64"; + + const auto path = root_dir / "externals" / "nitro" / platform / configuration / "share" / "nitf" / "plugins"; + const std::string putenv_ = "NITF_PLUGIN_PATH=" + path.string(); + _putenv(putenv_.c_str()); +} +#endif + +static int main_(int argc, char** argv) +{ + // make it a little easier to use from MSVC +#if defined(_DEBUG) && defined(_MSC_VER) + if (argc == 1) { - // create a parser and add our options to it - cli::ArgumentParser parser; - parser.setDescription("This program reads a SIDD/SICD along with a "\ - "directory of schemas, and returns any error messages "\ - "that may be contained in the DES XML"); - parser.addArgument("-f --log", "Specify a log file", cli::STORE, "log", - "FILE")->setDefault("console"); - parser.addArgument("-l --level", "Specify log level", cli::STORE, - "level", "LEVEL")->setChoices( - str::split("debug info warn error"))->setDefault( - "info"); - parser.addArgument("-s --schema", - "Specify a schema or directory of schemas", - cli::STORE, "schema", "FILE"); - parser.addArgument("input", "Input SICD/SIDD file or directory of files", cli::STORE, "input", - "INPUT", 1, 1); - - const std::unique_ptr - options(parser.parse(argc, (const char**) argv)); - - const std::string inputPath(options->get("input")); - std::vector inputPathnames = getPathnames(inputPath); - const std::string logFile(options->get("log")); - std::string level(options->get("level")); - std::vector schemaPaths; - getSchemaPaths(*options, "--schema", "schema", schemaPaths); - - // create an XML registry - // The reason to do this is to avoid adding XMLControlCreators to the - // XMLControlFactory singleton - this way has more fine-grained control - six::XMLControlRegistry xmlRegistry; - xmlRegistry.addCreator(six::DataType::COMPLEX, - new six::XMLControlCreatorT< - six::sicd::ComplexXMLControl>()); - xmlRegistry.addCreator(six::DataType::DERIVED, - new six::XMLControlCreatorT< - six::sidd::DerivedXMLControl>()); - - str::upper(level); - str::trim(level); - std::unique_ptr log = - logging::setupLogger(sys::Path::basename(argv[0]), level, logFile); - - // this validates the DES of the input against the - // best available schema - six::NITFReadControl reader; - reader.setLogger(log.get()); - reader.setXMLControlRegistry(&xmlRegistry); - bool allValid = true; - for (size_t ii = 0; ii < inputPathnames.size(); ++ii) + setNitfPluginPath(); + + // ./six/modules/c++/six/tests/nitf/sidd_1.0.0.nitf + static const auto nitf_path = getNitfPath().string(); + argc = 2; + auto argv_ = static_cast(malloc(argc * sizeof(char*))); + argv_[0] = argv[0]; + argv_[1] = const_cast(nitf_path.c_str()); + //argv[1] + argv = argv_; + } +#endif + + + // create a parser and add our options to it + cli::ArgumentParser parser; + parser.setDescription("This program reads a SIDD/SICD along with a "\ + "directory of schemas, and returns any error messages "\ + "that may be contained in the DES XML"); + parser.addArgument("-f --log", "Specify a log file", cli::STORE, "log", + "FILE")->setDefault("console"); + parser.addArgument("-l --level", "Specify log level", cli::STORE, + "level", "LEVEL")->setChoices( + str::split("debug info warn error"))->setDefault( + "info"); + parser.addArgument("-s --schema", + "Specify a schema or directory of schemas", + cli::STORE, "schema", "FILE"); + parser.addArgument("input", "Input SICD/SIDD file or directory of files", cli::STORE, "input", + "INPUT", 1, 1); + + const std::unique_ptr + options(parser.parse(argc, (const char**) argv)); + + const std::string inputPath(options->get("input")); + std::vector inputPathnames = getPathnames(inputPath); + const std::string logFile(options->get("log")); + std::string level(options->get("level")); + std::vector schemaPaths; + getSchemaPaths(*options, "--schema", "schema", schemaPaths); + + // create an XML registry + // The reason to do this is to avoid adding XMLControlCreators to the + // XMLControlFactory singleton - this way has more fine-grained control + six::XMLControlRegistry xmlRegistry; + xmlRegistry.addCreator(six::DataType::COMPLEX, + new six::XMLControlCreatorT< + six::sicd::ComplexXMLControl>()); + xmlRegistry.addCreator(six::DataType::DERIVED, + new six::XMLControlCreatorT< + six::sidd::DerivedXMLControl>()); + + str::upper(level); + str::trim(level); + std::unique_ptr log = + logging::setupLogger(sys::Path::basename(argv[0]), level, logFile); + + // this validates the DES of the input against the + // best available schema + six::NITFReadControl reader; + reader.setLogger(log.get()); + reader.setXMLControlRegistry(&xmlRegistry); + bool allValid = true; + for (size_t ii = 0; ii < inputPathnames.size(); ++ii) + { + const std::string& inputPathname(inputPathnames[ii]); + log->info(Ctxt("Reading " + inputPathname)); + std::unique_ptr data; + try { - const std::string& inputPathname(inputPathnames[ii]); - log->info(Ctxt("Reading " + inputPathname)); - std::unique_ptr data; - try + if (nitf::Reader::getNITFVersion(inputPathname) == + NITF_VER_UNKNOWN) { - if (nitf::Reader::getNITFVersion(inputPathname) == - NITF_VER_UNKNOWN) + data = six::parseDataFromFile(xmlRegistry, + inputPathname, + schemaPaths, + *log); + allValid = allValid && runValidation(data, log); + } + else + { + reader.load(inputPathname, schemaPaths); + mem::SharedPtr container = + reader.getContainer(); + for (size_t jj = 0; jj < container->getNumData(); ++jj) { - data = six::parseDataFromFile(xmlRegistry, - inputPathname, - schemaPaths, - *log); + data.reset(container->getData(jj)->clone()); allValid = allValid && runValidation(data, log); } - else - { - reader.load(inputPathname, schemaPaths); - mem::SharedPtr container = - reader.getContainer(); - for (size_t jj = 0; jj < container->getNumData(); ++jj) - { - data.reset(container->getData(jj)->clone()); - allValid = allValid && runValidation(data, log); - } - } - - } - catch (const six::DESValidationException& ex) - { - log->error(ex); - log->error(Ctxt("Unsuccessful: Please contact your product " - "vendor with these details!")); - allValid = false; - } - catch (const except::Exception& ex) - { - log->error(ex); - allValid = false; } + + } + catch (const six::DESValidationException& ex) + { + log->error(ex); + log->error(Ctxt("Unsuccessful: Please contact your product " + "vendor with these details!")); + allValid = false; } + catch (const except::Exception& ex) + { + log->error(ex); + allValid = false; + } + } - return allValid ? 0 : 1; + return allValid ? EXIT_SUCCESS : EXIT_FAILURE; +} +int main(int argc, char** argv) +{ + try + { + return main_(argc, argv); } catch (const std::exception& ex) { std::cerr << ex.what() << std::endl; - return 1; } catch (const except::Exception& ex) { std::cerr << ex.toString() << std::endl; - return 1; } catch (...) { std::cerr << "Unknown exception\n"; - return 1; } -} + + return EXIT_FAILURE; +} \ No newline at end of file diff --git a/six/modules/c++/samples/check_valid_six/check_valid_six.vcxproj b/six/modules/c++/samples/check_valid_six/check_valid_six.vcxproj new file mode 100644 index 000000000..fa0e26f8b --- /dev/null +++ b/six/modules/c++/samples/check_valid_six/check_valid_six.vcxproj @@ -0,0 +1,176 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {f0e2c8ff-57d4-4331-9bd2-76ff01cb54eb} + checkvalidsix + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + + + Application + false + v142 + true + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + $(SolutionDir)six\modules\c++\scene\include\;$(SolutionDir)six\modules\c++\six\include\;$(SolutionDir)six\modules\c++\six.sidd\include\;$(SolutionDir)six\modules\c++\six.sicd\include\;$(SolutionDir)six\modules\c++\cphd\include\;$(SolutionDir)six\modules\c++\cphd03\include\;$(SolutionDir)externals\coda-oss\install-$(Configuration)-$(Platform).$(PlatformToolset)\include\;$(SolutionDir)externals\nitro\modules\c++\nitf\include\;$(SolutionDir)externals\nitro\modules\c\nitf\include\;$(SolutionDir)externals\nitro\modules\c\nrt\include\; + Use + pch.h + pch.h + stdcpp17 + + + Console + true + $(SolutionDir)externals\coda-oss\install-$(Configuration)-$(Platform).$(PlatformToolset)\lib\;%(AdditionalLibraryDirectories) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + $(SolutionDir)six\modules\c++\scene\include\;$(SolutionDir)six\modules\c++\six\include\;$(SolutionDir)six\modules\c++\six.sidd\include\;$(SolutionDir)six\modules\c++\six.sicd\include\;$(SolutionDir)six\modules\c++\cphd\include\;$(SolutionDir)six\modules\c++\cphd03\include\;$(SolutionDir)externals\coda-oss\install-$(Configuration)-$(Platform).$(PlatformToolset)\include\;$(SolutionDir)externals\nitro\modules\c++\nitf\include\;$(SolutionDir)externals\nitro\modules\c\nitf\include\;$(SolutionDir)externals\nitro\modules\c\nrt\include\; + Use + pch.h + pch.h + stdcpp17 + + + Console + true + true + true + $(SolutionDir)externals\coda-oss\install-$(Configuration)-$(Platform).$(PlatformToolset)\lib\;%(AdditionalLibraryDirectories) + + + + + + Create + Create + + + + + + + + + + + + {34ac2314-fbd1-42ad-aaf4-0cebc6bf737e} + + + {ddc587c2-53ba-44a9-94e7-07be52af3d0b} + + + + + + \ No newline at end of file diff --git a/six/modules/c++/samples/check_valid_six/check_valid_six.vcxproj.filters b/six/modules/c++/samples/check_valid_six/check_valid_six.vcxproj.filters new file mode 100644 index 000000000..d677523b4 --- /dev/null +++ b/six/modules/c++/samples/check_valid_six/check_valid_six.vcxproj.filters @@ -0,0 +1,30 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/six/modules/c++/samples/check_valid_six/pch.cpp b/six/modules/c++/samples/check_valid_six/pch.cpp new file mode 100644 index 000000000..1d9f38c57 --- /dev/null +++ b/six/modules/c++/samples/check_valid_six/pch.cpp @@ -0,0 +1 @@ +#include "pch.h" diff --git a/six/modules/c++/samples/check_valid_six/pch.h b/six/modules/c++/samples/check_valid_six/pch.h new file mode 100644 index 000000000..4b84bf1f8 --- /dev/null +++ b/six/modules/c++/samples/check_valid_six/pch.h @@ -0,0 +1,73 @@ +#pragma once + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers + +// We're building in Visual Studio ... used to control where we get a little bit of config info +#define NITRO_PCH 1 + +#pragma warning(disable: 4668) // '...' is not defined as a preprocessor macro, replacing with '...' for '...' +#pragma warning(disable: 4820) // '...': '...' bytes padding added after data member '...' +#pragma warning(disable: 4710) // '...': function not inlined + +#pragma warning(disable: 5045) // Compiler will insert Spectre mitigation for memory load if / Qspectre switch specified + +#pragma warning(disable: 4625) // '...': copy constructor was implicitly defined as deleted +#pragma warning(disable: 4626) // '...': assignment operator was implicitly defined as deleted +#pragma warning(disable: 5026) // '...': move constructor was implicitly defined as deleted +#pragma warning(disable: 5027) // '...': move assignment operator was implicitly defined as deleted + +// TODO: get rid of these someday? +#pragma warning(disable: 4774) // '...' : format string expected in argument 3 is not a string literal +#pragma warning(disable: 4100) // '...': unreferenced formal parameter +#pragma warning(disable: 4296) // '...': expression is always false +#pragma warning(disable: 4267) // '...': conversion from '...' to '...', possible loss of data +#pragma warning(disable: 4244) // '...': conversion from '...' to '...', possible loss of data +#pragma warning(disable: 4242) // '...': conversion from '...' to '...', possible loss of data +#pragma warning(disable: 4018) // '...': signed / unsigned mismatch +#pragma warning(disable: 4389) // '...': signed / unsigned mismatch +#pragma warning(disable: 4365) // '...': conversion from '...' to '...', signed / unsigned mismatch +#pragma warning(disable: 5219) // implicit conversion from '...' to '...', possible loss of data +#pragma warning(disable: 5039) // '...': pointer or reference to potentially throwing function passed to 'extern "C"' function under - EHc.Undefined behavior may occur if this function throws an exception. +#pragma warning(disable: 4355) // '...': used in base member initializer list +#pragma warning(disable: 4514) // '...': unreferenced inline function has been removed + +// TODO: get rid of these someday? ... from Visual Studio code-analysis +#pragma warning(disable: 26495) // Variable '...' is uninitialized. Always initialize a member variable(type.6). +#pragma warning(disable: 26451) // Arithmetic overflow : Using operator '...' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow(io.2). +#pragma warning(disable: 6385) // Reading invalid data from '...': the readable size is '...' bytes, but '...' bytes may be read. +#pragma warning(disable: 6386) // Buffer overrun while writing to '...': the writable size is '...' bytes, but '...' bytes might be written. + +#pragma warning(push) +#pragma warning(disable: 5220) // '...': a non - static data member with a volatile qualified type no longer implies +#pragma warning(disable: 5204) // 'Concurrency::details::_DefaultPPLTaskScheduler': class has virtual functions, but its trivial destructor is not virtual; instances of objects derived from this class may not be destructed correctly + +#include "../../cpp_pch.h" + +#include + +#pragma warning(pop) + +#include +#include +#include +#pragma warning(push) +#pragma warning(disable: 26493) // Don't use C-style casts (type.4). +#pragma warning(disable: 26473) // Don't cast between pointer types where the source type and the target type are the same (type.1). +#include +#include +#pragma warning(pop) +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#pragma comment(lib, "cli-c++") diff --git a/six/modules/c++/scene/framework.h b/six/modules/c++/scene/framework.h index 7356ecda4..889116b73 100644 --- a/six/modules/c++/scene/framework.h +++ b/six/modules/c++/scene/framework.h @@ -40,37 +40,11 @@ #pragma warning(push) #pragma warning(disable: 5220) // '...': a non - static data member with a volatile qualified type no longer implies #pragma warning(disable: 5204) // 'Concurrency::details::_DefaultPPLTaskScheduler': class has virtual functions, but its trivial destructor is not virtual; instances of objects derived from this class may not be destructed correctly -#include -#include -#define _USE_MATH_DEFINES -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "../../cpp_pch.h" #include -#include -#undef min -#undef max #pragma warning(pop) #include diff --git a/six/modules/c++/six.convert/framework.h b/six/modules/c++/six.convert/framework.h index 121ac3772..6b82bab16 100644 --- a/six/modules/c++/six.convert/framework.h +++ b/six/modules/c++/six.convert/framework.h @@ -40,37 +40,11 @@ #pragma warning(push) #pragma warning(disable: 5220) // '...': a non - static data member with a volatile qualified type no longer implies #pragma warning(disable: 5204) // 'Concurrency::details::_DefaultPPLTaskScheduler': class has virtual functions, but its trivial destructor is not virtual; instances of objects derived from this class may not be destructed correctly -#include -#include -#define _USE_MATH_DEFINES -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#include "../../cpp_pch.h" #include -#include -#undef min -#undef max #pragma warning(pop) #include diff --git a/six/modules/c++/six.sicd/framework.h b/six/modules/c++/six.sicd/framework.h index e614f97e9..345c6be7b 100644 --- a/six/modules/c++/six.sicd/framework.h +++ b/six/modules/c++/six.sicd/framework.h @@ -40,37 +40,11 @@ #pragma warning(push) #pragma warning(disable: 5220) // '...': a non - static data member with a volatile qualified type no longer implies #pragma warning(disable: 5204) // 'Concurrency::details::_DefaultPPLTaskScheduler': class has virtual functions, but its trivial destructor is not virtual; instances of objects derived from this class may not be destructed correctly -#include -#include -#define _USE_MATH_DEFINES -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#include "../../cpp_pch.h" #include -#include -#undef min -#undef max #pragma warning(pop) #include diff --git a/six/modules/c++/six.sidd/framework.h b/six/modules/c++/six.sidd/framework.h index edfbdb8b0..848ea5d84 100644 --- a/six/modules/c++/six.sidd/framework.h +++ b/six/modules/c++/six.sidd/framework.h @@ -40,37 +40,11 @@ #pragma warning(push) #pragma warning(disable: 5220) // '...': a non - static data member with a volatile qualified type no longer implies #pragma warning(disable: 5204) // 'Concurrency::details::_DefaultPPLTaskScheduler': class has virtual functions, but its trivial destructor is not virtual; instances of objects derived from this class may not be destructed correctly -#include -#include -#define _USE_MATH_DEFINES -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#include "../../cpp_pch.h" #include -#include -#undef min -#undef max #pragma warning(pop) #include diff --git a/six/modules/c++/six/framework.h b/six/modules/c++/six/framework.h index 282edc5fa..f02f67e35 100644 --- a/six/modules/c++/six/framework.h +++ b/six/modules/c++/six/framework.h @@ -40,37 +40,11 @@ #pragma warning(push) #pragma warning(disable: 5220) // '...': a non - static data member with a volatile qualified type no longer implies #pragma warning(disable: 5204) // 'Concurrency::details::_DefaultPPLTaskScheduler': class has virtual functions, but its trivial destructor is not virtual; instances of objects derived from this class may not be destructed correctly -#include -#include -#define _USE_MATH_DEFINES -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#include "../../cpp_pch.h" #include -#include -#undef min -#undef max #pragma warning(pop) #include