From 59c50053a651a42434934b589918724510d5615e Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 9 Nov 2020 16:13:34 +0100 Subject: [PATCH] MSVC: [skip ci] make working with C++17 compiler --- src/3rdParty/salomesmesh/inc/Basics_Utils.hxx | 3 +++ src/3rdParty/salomesmesh/inc/GEOMUtils.hxx | 5 ++++- src/3rdParty/salomesmesh/inc/SMESH_ExceptHandlers.hxx | 4 ++-- src/App/Application.cpp | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/3rdParty/salomesmesh/inc/Basics_Utils.hxx b/src/3rdParty/salomesmesh/inc/Basics_Utils.hxx index dd97bb9a68..20d0923c97 100644 --- a/src/3rdParty/salomesmesh/inc/Basics_Utils.hxx +++ b/src/3rdParty/salomesmesh/inc/Basics_Utils.hxx @@ -32,6 +32,9 @@ #ifndef WIN32 #include #else +// avoid name collision with std::byte in C++17 +#define NOCRYPT +#define NOGDI #include #include #pragma comment(lib,"winmm.lib") diff --git a/src/3rdParty/salomesmesh/inc/GEOMUtils.hxx b/src/3rdParty/salomesmesh/inc/GEOMUtils.hxx index 8ffa25be2e..7d92b8ab0e 100644 --- a/src/3rdParty/salomesmesh/inc/GEOMUtils.hxx +++ b/src/3rdParty/salomesmesh/inc/GEOMUtils.hxx @@ -106,8 +106,11 @@ namespace GEOMUtils * \brief Sort shapes in the list by their coordinates. * \param SL The list of shapes to sort. */ - struct CompareShapes : public std::binary_function + struct CompareShapes { + typedef TopoDS_Shape first_argument_type; + typedef TopoDS_Shape second_argument_type; + typedef bool result_type; CompareShapes (bool isOldSorting) : myIsOldSorting(isOldSorting) {} diff --git a/src/3rdParty/salomesmesh/inc/SMESH_ExceptHandlers.hxx b/src/3rdParty/salomesmesh/inc/SMESH_ExceptHandlers.hxx index 79b6aefe63..50cd06c805 100644 --- a/src/3rdParty/salomesmesh/inc/SMESH_ExceptHandlers.hxx +++ b/src/3rdParty/salomesmesh/inc/SMESH_ExceptHandlers.hxx @@ -57,8 +57,8 @@ class SMESH_EXPORT Unexpect { //save / retrieve unexpected exceptions treatment ~Unexpect() { /*std::set_unexpected(old);*/ } #else Unexpect( PVF f ) - { old = std::set_unexpected(f); } - ~Unexpect() { std::set_unexpected(old); } + { old = ::set_unexpected(f); } + ~Unexpect() { ::set_unexpected(old); } #endif }; diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 5c7fb90814..51059658c3 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -1704,7 +1704,7 @@ void Application::init(int argc, char ** argv) std::signal(SIGSEGV,segmentation_fault_handler); std::signal(SIGABRT,segmentation_fault_handler); std::set_terminate(unhandled_exception_handler); - std::set_unexpected(unexpection_error_handler); + ::set_unexpected(unexpection_error_handler); #elif defined(FC_OS_LINUX) std::signal(SIGSEGV,segmentation_fault_handler); #endif