From 6c7c9e24898168f8086c108e02b3b735e9277e33 Mon Sep 17 00:00:00 2001 From: Iulian Grindeanu Date: Wed, 19 Oct 2016 14:47:01 -0500 Subject: [PATCH] guard if DEPRECATED is defined already also, show the use of the deprecated constructor a warning will show up maybe we want to remove the warning from tests? --- src/moab/Matrix3.hpp | 15 ++++++++------- test/test_Matrix3.cpp | 5 +++++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/moab/Matrix3.hpp b/src/moab/Matrix3.hpp index 486b1ee44..37f172fb9 100644 --- a/src/moab/Matrix3.hpp +++ b/src/moab/Matrix3.hpp @@ -345,12 +345,13 @@ public: row0[2], row1[2], row2[2]; } } - -#ifdef __GNUC__ -#define DEPRECATED __attribute__((deprecated)) -#else -#pragma message("WARNING: You need to implement DEPRECATED for this compiler") -#define DEPRECATED +#ifndef DEPRECATED + #ifdef __GNUC__ + #define DEPRECATED __attribute__((deprecated)) + #else + #pragma message("WARNING: You need to implement DEPRECATED for this compiler") + #define DEPRECATED + #endif #endif /* * \deprecated { Use instead the constructor with explicit fourth argument, bool isRow, above } @@ -365,7 +366,7 @@ public: row1[0], row1[1], row1[2], row2[0], row2[1], row2[2]; } -#undef DEPRECATED + inline Matrix3( const double v[9] ){ _mat << v[0], v[1], v[2], diff --git a/test/test_Matrix3.cpp b/test/test_Matrix3.cpp index d9049a3a8..7b490995f 100644 --- a/test/test_Matrix3.cpp +++ b/test/test_Matrix3.cpp @@ -97,6 +97,11 @@ void test_EigenDecomp() //now verfy that the returns Eigenvalues and Eigenvectors are correct (within some tolerance) double tol = 1e-04; + + // use a deprecated constructor + Matrix3 mat3( CartVect(2, -1, 0), CartVect(-1, 2, -1), CartVect(0, -1, 2)); + CHECK_REAL_EQUAL( mat(1), mat3(1), tol); + vec0_check.normalize(); vec1_check.normalize(); vec2_check.normalize(); -- GitLab