Skip to content

Commit

Permalink
Fix KDL_VERSION test
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaschke committed Dec 20, 2024
1 parent 4b0145f commit c53601d
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*********************************************************************/

#include <kdl/config.h>
#include "pilz_industrial_motion_planner/path_circle_generator.h"
#define KDL_VERSION_LESS(a, b, c) ((KDL_VERSION) < ((a << 16) | (b << 8) | c))

namespace pilz_industrial_motion_planner
{
Expand Down Expand Up @@ -65,9 +67,8 @@ std::unique_ptr<KDL::Path> PathCircleGenerator::circleFromCenter(const KDL::Fram
}
catch (KDL::Error_MotionPlanning&)
{
#if KDL_VERSION < ((1 << 16) | (4 << 8) | 1) // older than 1.4.1 ?
delete rot_interpo; // in case we could not construct the Path object,
// avoid a memory leak
#if KDL_VERSION_LESS(1, 4, 1) // older than 1.4.1 ?
delete rot_interpo; // in case we could not construct the Path object, avoid a memory leak
#endif
KDL::epsilon = old_kdl_epsilon;
throw; // and pass the exception on to the caller
Expand Down Expand Up @@ -134,9 +135,8 @@ std::unique_ptr<KDL::Path> PathCircleGenerator::circleFromInterim(const KDL::Fra
// above,
// we keep these lines to be safe
{
#if KDL_VERSION < ((1 << 16) | (4 << 8) | 1) // older than 1.4.1 ?
delete rot_interpo; // in case we could not construct the Path object,
// avoid a memory leak
#if KDL_VERSION_LESS(1, 4, 1) // older than 1.4.1 ?
delete rot_interpo; // in case we could not construct the Path object, avoid a memory leak
#endif
throw; // and pass the exception on to the caller
// LCOV_EXCL_STOP
Expand Down

0 comments on commit c53601d

Please sign in to comment.