From 57be7cad6de953081ade19daf069bd4c2dc7eb76 Mon Sep 17 00:00:00 2001 From: Max Lyon Date: Tue, 25 Apr 2017 15:50:30 +0200 Subject: [PATCH 1/2] enable c++11 features of property manager for Visual Studio 2013 --- src/OpenMesh/Core/Utils/PropertyManager.hh | 6 +++--- src/Unittests/unittests_propertymanager.cc | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/OpenMesh/Core/Utils/PropertyManager.hh b/src/OpenMesh/Core/Utils/PropertyManager.hh index 2f38ca40..ae8ad189 100644 --- a/src/OpenMesh/Core/Utils/PropertyManager.hh +++ b/src/OpenMesh/Core/Utils/PropertyManager.hh @@ -92,7 +92,7 @@ namespace OpenMesh { */ template class PropertyManager { -#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) +#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) public: PropertyManager(const PropertyManager&) = delete; PropertyManager& operator=(const PropertyManager&) = delete; @@ -167,7 +167,7 @@ class PropertyManager { MeshT &getMesh() const { return *mesh_; } -#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) +#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) /// Only for pre C++11 compatibility. typedef PropertyManager Proxy; @@ -410,7 +410,7 @@ class PropertyManager { (*this)[*begin] = value; } -#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) +#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) template void set_range(const HandleTypeIteratorRange &range, const PROP_VALUE &value) { diff --git a/src/Unittests/unittests_propertymanager.cc b/src/Unittests/unittests_propertymanager.cc index 7a1f1d21..3fd7b646 100644 --- a/src/Unittests/unittests_propertymanager.cc +++ b/src/Unittests/unittests_propertymanager.cc @@ -93,7 +93,7 @@ TEST_F(OpenMeshPropertyManager, set_range_bool) { ASSERT_TRUE(pm_f_bool[*f_it]); } -#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) +#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) /* * Same thing again, this time with C++11 ranges. */ @@ -137,7 +137,7 @@ TEST_F(OpenMeshPropertyManager, set_range_bool) { * C++11 Specific Tests * ==================================================================== */ -#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) +#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) template bool has_property(const Mesh& _mesh, const std::string& _name) { From 45f3b8187d7b50ae96ca3f2dc336ca2762ed1e85 Mon Sep 17 00:00:00 2001 From: Max Lyon Date: Tue, 25 Apr 2017 16:03:19 +0200 Subject: [PATCH 2/2] enable more c++11 features for Visual Studio 2013 --- src/OpenMesh/Apps/Decimating/DecimaterViewerWidget.hh | 2 +- src/OpenMesh/Apps/Unsupported/OsgViewer/osgviewer.cc | 2 +- src/OpenMesh/Apps/VDProgMesh/Analyzer/vdpmanalyzer.cc | 2 +- src/OpenMesh/Core/Mesh/IteratorsT.hh | 2 +- src/OpenMesh/Core/System/config.h | 2 +- src/OpenMesh/Core/System/mostream.hh | 8 ++++---- src/OpenMesh/Core/Utils/PropertyContainer.hh | 2 +- src/OpenMesh/Tools/Decimater/DecimaterT.cc | 6 +++--- src/OpenMesh/Tools/Decimater/DecimaterT.hh | 2 +- src/OpenMesh/Tools/Utils/HeapT.hh | 4 ++-- src/OpenMesh/Tools/VDPM/ViewingParameters.cc | 2 +- src/Python/Vector.hh | 2 +- src/Unittests/unittests_cpp_11_features.cc | 2 +- 13 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/OpenMesh/Apps/Decimating/DecimaterViewerWidget.hh b/src/OpenMesh/Apps/Decimating/DecimaterViewerWidget.hh index 9b8fa4d9..c3caec9a 100644 --- a/src/OpenMesh/Apps/Decimating/DecimaterViewerWidget.hh +++ b/src/OpenMesh/Apps/Decimating/DecimaterViewerWidget.hh @@ -114,7 +114,7 @@ public: typedef Decimater::ModNormalFlippingT< mesh_t >::Handle mod_nf_t; // object types -#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) +#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) typedef std::unique_ptr< decimater_t > decimater_o; #else typedef std::auto_ptr< decimater_t > decimater_o; diff --git a/src/OpenMesh/Apps/Unsupported/OsgViewer/osgviewer.cc b/src/OpenMesh/Apps/Unsupported/OsgViewer/osgviewer.cc index e5d4a87f..1d12bb9c 100644 --- a/src/OpenMesh/Apps/Unsupported/OsgViewer/osgviewer.cc +++ b/src/OpenMesh/Apps/Unsupported/OsgViewer/osgviewer.cc @@ -131,7 +131,7 @@ public: bool bind( osg::GeometryPtr geo ) { - #if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) + #if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) std::unique_ptr obj(new mesh_t); #else std::auto_ptr obj(new mesh_t); diff --git a/src/OpenMesh/Apps/VDProgMesh/Analyzer/vdpmanalyzer.cc b/src/OpenMesh/Apps/VDProgMesh/Analyzer/vdpmanalyzer.cc index c939fb39..de55f84d 100644 --- a/src/OpenMesh/Apps/VDProgMesh/Analyzer/vdpmanalyzer.cc +++ b/src/OpenMesh/Apps/VDProgMesh/Analyzer/vdpmanalyzer.cc @@ -851,7 +851,7 @@ compute_screen_space_error(VHierarchyNodeHandle node_handle, VHierarchyNodeHandl Vec3f residual; Vec3f res; Vec3f lp; -#if ((defined(_MSC_VER) && (_MSC_VER >= 1900)) ) +#if ((defined(_MSC_VER) && (_MSC_VER >= 1800)) ) // Workaround for internal compiler error Vec3f tri[3]{ {},{},{} }; #else diff --git a/src/OpenMesh/Core/Mesh/IteratorsT.hh b/src/OpenMesh/Core/Mesh/IteratorsT.hh index ca0d31e9..38df6ecf 100644 --- a/src/OpenMesh/Core/Mesh/IteratorsT.hh +++ b/src/OpenMesh/Core/Mesh/IteratorsT.hh @@ -170,7 +170,7 @@ class GenericIteratorT { return cpy; } -#if ((defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENMESH_VECTOR_LEGACY) +#if ((defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENMESH_VECTOR_LEGACY) template auto operator+=(int amount) -> typename std::enable_if< diff --git a/src/OpenMesh/Core/System/config.h b/src/OpenMesh/Core/System/config.h index 2e6f50c6..b48b1536 100644 --- a/src/OpenMesh/Core/System/config.h +++ b/src/OpenMesh/Core/System/config.h @@ -102,7 +102,7 @@ typedef unsigned int uint; -#if ((defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) +#if ((defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) #define OM_HAS_HASH #endif diff --git a/src/OpenMesh/Core/System/mostream.hh b/src/OpenMesh/Core/System/mostream.hh index ac4235c3..4dabf51c 100644 --- a/src/OpenMesh/Core/System/mostream.hh +++ b/src/OpenMesh/Core/System/mostream.hh @@ -70,7 +70,7 @@ #include #include -#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ ) +#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ ) #include #endif @@ -189,7 +189,7 @@ protected: virtual int sync() { // If working on multiple threads, we need to serialize the output correctly (requires c++11 headers) - #if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ ) + #if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ ) std::lock_guard lck (serializer_); #endif @@ -214,7 +214,7 @@ protected: char c = traits_type::to_char_type(_c); // If working on multiple threads, we need to serialize the output correctly (requires c++11 headers) - #if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ ) + #if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ ) { std::lock_guard lck (serializer_); buffer_.push_back(c); @@ -264,7 +264,7 @@ private: bool enabled_; // If working on multiple threads, we need to serialize the output correctly (requires c++11 headers) - #if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ ) + #if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ ) std::mutex serializer_; #endif diff --git a/src/OpenMesh/Core/Utils/PropertyContainer.hh b/src/OpenMesh/Core/Utils/PropertyContainer.hh index ae8d9dfc..d8d7393d 100644 --- a/src/OpenMesh/Core/Utils/PropertyContainer.hh +++ b/src/OpenMesh/Core/Utils/PropertyContainer.hh @@ -204,7 +204,7 @@ public: * In C++11 an beyond we can introduce more efficient and more legible * implementations of the following methods. */ -#if ((defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENMESH_VECTOR_LEGACY) +#if ((defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENMESH_VECTOR_LEGACY) /** * Reserves space for \p _n elements in all property vectors. */ diff --git a/src/OpenMesh/Tools/Decimater/DecimaterT.cc b/src/OpenMesh/Tools/Decimater/DecimaterT.cc index a7e18dce..2ca41a7c 100644 --- a/src/OpenMesh/Tools/Decimater/DecimaterT.cc +++ b/src/OpenMesh/Tools/Decimater/DecimaterT.cc @@ -78,7 +78,7 @@ template DecimaterT::DecimaterT(Mesh& _mesh) : BaseDecimaterT(_mesh), mesh_(_mesh), -#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ ) +#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ ) heap_(nullptr) #else heap_(NULL) @@ -178,7 +178,7 @@ size_t DecimaterT::decimate(size_t _n_collapses) { // initialize heap HeapInterface HI(mesh_, priority_, heap_position_); -#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ ) +#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ ) heap_ = std::unique_ptr(new DeciHeap(HI)); #else heap_ = std::auto_ptr(new DeciHeap(HI)); @@ -282,7 +282,7 @@ size_t DecimaterT::decimate_to_faces(size_t _nv, size_t _nf) { // initialize heap HeapInterface HI(mesh_, priority_, heap_position_); - #if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ ) + #if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ ) heap_ = std::unique_ptr(new DeciHeap(HI)); #else heap_ = std::auto_ptr(new DeciHeap(HI)); diff --git a/src/OpenMesh/Tools/Decimater/DecimaterT.hh b/src/OpenMesh/Tools/Decimater/DecimaterT.hh index 2c71a093..55cf080f 100644 --- a/src/OpenMesh/Tools/Decimater/DecimaterT.hh +++ b/src/OpenMesh/Tools/Decimater/DecimaterT.hh @@ -195,7 +195,7 @@ private: //------------------------------------------------------- private data Mesh& mesh_; // heap - #if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ ) + #if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ ) std::unique_ptr heap_; #else std::auto_ptr heap_; diff --git a/src/OpenMesh/Tools/Utils/HeapT.hh b/src/OpenMesh/Tools/Utils/HeapT.hh index 5a28ff7f..63c27c25 100644 --- a/src/OpenMesh/Tools/Utils/HeapT.hh +++ b/src/OpenMesh/Tools/Utils/HeapT.hh @@ -79,7 +79,7 @@ #include "Config.hh" #include #include -#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) +#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) #include #endif @@ -150,7 +150,7 @@ public: /// Constructor HeapT() : HeapVector() {} -#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) +#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) /// Construct with a given \c HeapIterface. HeapT(HeapInterface _interface) : HeapVector(), interface_(std::move(_interface)) diff --git a/src/OpenMesh/Tools/VDPM/ViewingParameters.cc b/src/OpenMesh/Tools/VDPM/ViewingParameters.cc index 065c9319..f32cb802 100644 --- a/src/OpenMesh/Tools/VDPM/ViewingParameters.cc +++ b/src/OpenMesh/Tools/VDPM/ViewingParameters.cc @@ -92,7 +92,7 @@ update_viewing_configurations() Vec3f trans; // Workaround for internal compiler error on Visual Studio 2015 Update 1 -#if ((defined(_MSC_VER) && (_MSC_VER >= 1900)) ) +#if ((defined(_MSC_VER) && (_MSC_VER >= 1800)) ) Vec3f inv_rot[3]{ {},{},{} }; Vec3f normal[4]{ {},{},{},{} }; #else diff --git a/src/Python/Vector.hh b/src/Python/Vector.hh index 31e3ff34..1aa38519 100644 --- a/src/Python/Vector.hh +++ b/src/Python/Vector.hh @@ -123,7 +123,7 @@ void expose_vec(const char *_name) { Vector& (Vector::*normalize )(void ) = &Vector::normalize; Vector& (Vector::*normalize_cond)(void ) = &Vector::normalize_cond; -#if (_MSC_VER >= 1900 || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENMESH_VECTOR_LEGACY) +#if (_MSC_VER >= 1800 || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENMESH_VECTOR_LEGACY) Vector (Vector::*normalized)() const = &Vector::normalized; #else const Vector (Vector::*normalized)() const = &Vector::normalized; diff --git a/src/Unittests/unittests_cpp_11_features.cc b/src/Unittests/unittests_cpp_11_features.cc index a001cf9c..c6d673e4 100644 --- a/src/Unittests/unittests_cpp_11_features.cc +++ b/src/Unittests/unittests_cpp_11_features.cc @@ -53,7 +53,7 @@ class OpenMesh_Triangle : public OpenMeshBase { * ==================================================================== */ -#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) +#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) /* */