MSVC: [skip ci] make working with C++17 compiler

This commit is contained in:
wmayer
2020-11-09 16:13:34 +01:00
parent 59867215ea
commit f0aba7a561
4 changed files with 10 additions and 4 deletions

View File

@@ -32,6 +32,9 @@
#ifndef WIN32
#include <sys/time.h>
#else
// avoid name collision with std::byte in C++17
#define NOCRYPT
#define NOGDI
#include <winsock2.h>
#include <windows.h>
#pragma comment(lib,"winmm.lib")

View File

@@ -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<TopoDS_Shape, TopoDS_Shape, bool>
struct CompareShapes
{
typedef TopoDS_Shape first_argument_type;
typedef TopoDS_Shape second_argument_type;
typedef bool result_type;
CompareShapes (bool isOldSorting)
: myIsOldSorting(isOldSorting) {}

View File

@@ -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
};

View File

@@ -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