Skip to content

Commit

Permalink
Possible better pcl_macro.h
Browse files Browse the repository at this point in the history
  • Loading branch information
kunaltyagi committed Feb 17, 2020
1 parent 57aea39 commit a4e46e7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 2 additions & 0 deletions common/include/pcl/make_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#include <boost/make_shared.hpp>
#include <boost/shared_ptr.hpp>

#include <Eigen/Core>

#include <pcl/point_traits.h>


Expand Down
6 changes: 0 additions & 6 deletions common/include/pcl/pcl_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@
#include <boost/cstdint.hpp>
#include <boost/smart_ptr/shared_ptr.hpp>

//Eigen has an enum that clashes with X11 Success define, which is ultimately included by pcl
#ifdef Success
#undef Success
#endif
#include <Eigen/Core>

This comment has been minimized.

Copy link
@taketwo

taketwo Feb 17, 2020

Member

But as we discussed, Eigen/Core has to be included here for the aligned operator new macro.

This comment has been minimized.

Copy link
@kunaltyagi

kunaltyagi Feb 17, 2020

Author Member

True. But the operator new is not required to be in this file. Removing Eigen/Core from here doesn't impact compilation. This implies one or more of the following

  • some other place is a better match for this macro to be (since this file is being included solely for the macro and the other functionality is coming from some other file)
  • this macro isn't needed: it is virtually identical to EIGEN macro except it declared and the typename is only used once in point_traits. That trait can use presence of custom new and delete operators instead. The operator signatures are standard and thus hardcoded. This is also more robust because EIGEN_MAKE_ALIGNED_OPERATOR_NEW can result in no code for C++17 or some Eigen config but the type trait doesn't ack that.

#include <pcl/pcl_config.h>

namespace pcl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@

#include <vector>

// Eigen has an enum that clashes with X11 Success macro, included by VTK below
// Do not include VTK GL before Eigen
#include <Eigen/Core>

#include "vtkObject.h"
#include "vtkWeakPointer.h"

Expand Down

0 comments on commit a4e46e7

Please sign in to comment.