Commit f23a7774 authored by Francois Keith's avatar Francois Keith
Browse files

Add Macros to wrap calls to pragma push/pop/ignore deprecation

parent 42f4c4b5
Pipeline #12633 passed with stage
in 153 minutes and 21 seconds
......@@ -40,19 +40,10 @@ namespace pinocchio
if (joint>0) geom_data.oMg[i] = (data.oMi[joint] * geom_model.geometryObjects[i].placement);
else geom_data.oMg[i] = geom_model.geometryObjects[i].placement;
#ifdef PINOCCHIO_WITH_HPP_FCL
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif defined (WIN32)
#pragma warning(push)
#pragma warning(disable : 4996)
#endif // __GNUC__
PINOCCHIO_COMPILER_DIAGNOSTIC_PUSH
PINOCCHIO_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
geom_data.collisionObjects[i].setTransform( toFclTransform3f(geom_data.oMg[i]) );
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined (WIN32)
#pragma warning(pop)
#endif // __GNUC__
PINOCCHIO_COMPILER_DIAGNOSTIC_POP
#endif // PINOCCHIO_WITH_HPP_FCL
}
}
......
......@@ -75,7 +75,22 @@ namespace pinocchio
}
}
// Handle explicitely the GCC borring warning: 'anonymous variadic macros were introduced in C++11'
/// \brief macros for pragma push/pop/ignore deprecated warnings
#if defined(__GNUC__) || defined(__clang__)
# define PINOCCHIO_COMPILER_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push")
# define PINOCCHIO_COMPILER_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop")
# define PINOCCHIO_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
#elif defined (WIN32)
# define PINOCCHIO_COMPILER_DIAGNOSTIC_PUSH _Pragma("warning(push)")
# define PINOCCHIO_COMPILER_DIAGNOSTIC_POP _Pragma("warning(pop)")
# define PINOCCHIO_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS _Pragma("warning(disable : 4996)")
#else
# define PINOCCHIO_COMPILER_DIAGNOSTIC_PUSH
# define PINOCCHIO_COMPILER_DIAGNOSTIC_POP
# define PINOCCHIO_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
#endif // __GNUC__
// Handle explicitely the GCC boring warning: 'anonymous variadic macros were introduced in C++11'
#include <exception>
#include <stdexcept>
......
......@@ -124,13 +124,8 @@ struct GeometryObject
/// \brief Absolute path to the mesh texture file.
std::string meshTexturePath;
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif defined (WIN32)
#pragma warning(push)
#pragma warning(disable : 4996)
#endif //__GNUC__
PINOCCHIO_COMPILER_DIAGNOSTIC_PUSH
PINOCCHIO_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
///
/// \brief Full constructor.
///
......@@ -167,19 +162,10 @@ struct GeometryObject
, meshColor(meshColor)
, meshTexturePath(meshTexturePath)
{}
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined (WIN32)
#pragma warning(pop)
#endif //__GNUC__
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif defined (WIN32)
#pragma warning(push)
#pragma warning(disable : 4996)
#endif //__GNUC__
PINOCCHIO_COMPILER_DIAGNOSTIC_POP
PINOCCHIO_COMPILER_DIAGNOSTIC_PUSH
PINOCCHIO_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
///
/// \brief Reduced constructor.
/// \remarks Compared to the other constructor, this one assumes that there is no parentFrame associated to the geometry.
......@@ -215,29 +201,16 @@ struct GeometryObject
, meshColor(meshColor)
, meshTexturePath(meshTexturePath)
{}
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined (WIN32)
#pragma warning(pop)
#endif //__GNUC__
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif defined (WIN32)
#pragma warning(push)
#pragma warning(disable : 4996)
#endif //__GNUC__
PINOCCHIO_COMPILER_DIAGNOSTIC_POP
PINOCCHIO_COMPILER_DIAGNOSTIC_PUSH
PINOCCHIO_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
GeometryObject(const GeometryObject & other)
: fcl(geometry)
{
*this = other;
}
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined (WIN32)
#pragma warning(pop)
#endif //__GNUC__
PINOCCHIO_COMPILER_DIAGNOSTIC_POP
GeometryObject & operator=(const GeometryObject & other)
{
......
......@@ -19,13 +19,8 @@
namespace pinocchio
{
// Avoid deprecated warning of collisionObjects
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif defined (WIN32)
#pragma warning(push)
#pragma warning(disable : 4996)
#endif //__GNUC__
PINOCCHIO_COMPILER_DIAGNOSTIC_PUSH
PINOCCHIO_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
inline GeometryData::GeometryData(const GeometryModel & geom_model)
: oMg(geom_model.ngeoms)
, activeCollisionPairs(geom_model.collisionPairs.size(), true)
......@@ -81,11 +76,7 @@ namespace pinocchio
{}
inline GeometryData::~GeometryData() {}
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined (WIN32)
#pragma warning(pop)
#endif //__GNUC__
PINOCCHIO_COMPILER_DIAGNOSTIC_POP
template<typename S2, int O2, template<typename,int> class JointCollectionTpl>
GeomIndex GeometryModel::addGeometryObject(const GeometryObject & object,
......
......@@ -60,19 +60,11 @@ namespace pinocchio
typedef Symmetric3Tpl <double,0> Symmetric3;
typedef MotionZeroTpl <double,0> MotionZero;
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif defined (WIN32)
#pragma warning(push)
#pragma warning(disable : 4996)
#endif //__GNUC__
PINOCCHIO_COMPILER_DIAGNOSTIC_PUSH
PINOCCHIO_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
typedef BiasZeroTpl <double,0> BiasZero;
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined (WIN32)
#pragma warning(pop)
#endif //__GNUC__
PINOCCHIO_COMPILER_DIAGNOSTIC_POP
/**
* @}
......
......@@ -125,13 +125,8 @@ namespace pinocchio
BiasZeroTpl(const Base &) {}
};
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif defined (WIN32)
#pragma warning(push)
#pragma warning(disable : 4996)
#endif //__GNUC__
PINOCCHIO_COMPILER_DIAGNOSTIC_PUSH
PINOCCHIO_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
template<typename Scalar, int Options>
struct SE3GroupAction< BiasZeroTpl<Scalar,Options> >
{
......@@ -143,11 +138,7 @@ namespace pinocchio
{
typedef BiasZeroTpl<Scalar,Options> ReturnType;
};
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined (WIN32)
#pragma warning(pop)
#endif //__GNUC__
PINOCCHIO_COMPILER_DIAGNOSTIC_POP
} // namespace pinocchio
......
Supports Markdown
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