Commit ec3667c1 authored by Matthias Möller's avatar Matthias Möller

- improve warning text

- add checkbox to disable warning

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@1232 fdac6126-5c0c-442c-9429-916003d36597
parent 3aa79dcd
......@@ -24,6 +24,10 @@ endif()
include (ACGOutput)
# ========================================================================
# Definitions
# ========================================================================
if (WIN32)
add_definitions(
-D_USE_MATH_DEFINES -DNOMINMAX
......@@ -31,6 +35,10 @@ if (WIN32)
)
endif ()
set(NO_DECREMENT_DEPRECATED_WARNINGS OFF CACHE BOOL "Disables all deprecated warnings warning about decrement operations on normal circulators.")
if(NO_DECREMENT_DEPRECATED_WARNINGS)
add_definitions( -DNO_DECREMENT_DEPRECATED_WARNINGS )
endif()
# ========================================================================
# Windows build style control
......
......@@ -485,7 +485,20 @@ class GenericCirculatorT_DEPRECATED : protected GenericCirculatorBaseT<Mesh> {
GenericCirculator_ValueHandleFns::increment(this->mesh_, this->heh_, this->start_, this->lap_counter_);
return *this;
}
DEPRECATED("current decrement operator is deprecated. Please use CCW/CW iterators.")
#ifndef NO_DECREMENT_DEPRECATED_WARNINGS
#define DECREMENT_DEPRECATED_WARNINGS_TEXT "The current decrement operator has the unintended behavior that it stays\
valid when iterating below the start and will visit the first entity\
twice before getting invalid. Furthermore it gets valid again, if you\
increment at the end.\
When you are sure that you don't iterate below the start anywhere in\
your code or rely on this behaviour, you can disable this warning by\
setting the define NO_DECREMENT_DEPRECATED_WARNINGS at the command line (or enable it via the\
cmake flags).\
To be save, you can use the CW/CCW circulator definitions, which behave\
the same as the original ones, without the previously mentioned issues."
DEPRECATED( DECREMENT_DEPRECATED_WARNINGS_TEXT )
#endif // NO_DECREMENT_DEPRECATED_WARNINGS
GenericCirculatorT_DEPRECATED& operator--() {
assert(this->mesh_);
GenericCirculator_ValueHandleFns::decrement(this->mesh_, this->heh_, this->start_, this->lap_counter_);
......@@ -501,7 +514,10 @@ class GenericCirculatorT_DEPRECATED : protected GenericCirculatorBaseT<Mesh> {
}
/// Post-decrement
DEPRECATED("current decrement operator is deprecated. Please use CCW/CW iterators.")
#ifndef NO_DECREMENT_DEPRECATED_WARNINGS
DEPRECATED( DECREMENT_DEPRECATED_WARNINGS_TEXT )
#undef DECREMENT_DEPRECATED_WARNINGS_TEXT
#endif //NO_DECREMENT_DEPRECATED_WARNINGS
GenericCirculatorT_DEPRECATED operator--(int) {
assert(this->mesh_);
GenericCirculatorT_DEPRECATED cpy(*this);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment