itask: reworked conditionals for osx version compatibility

This commit is contained in:
Jens Verwiebe
2012-11-07 21:19:43 +00:00
parent 204113b791
commit aa42934cef
2 changed files with 22 additions and 6 deletions

View File

@@ -35,11 +35,16 @@ namespace KDL {
*/
class Chain {
private:
#if !defined(__APPLE__)
#if defined(__APPLE__)
# if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_5
std::vector<Segment> segments;
# else
// Eigen allocator is needed for alignment of Eigen data types
std::vector<Segment, Eigen::aligned_allocator<Segment> > segments;
# endif /* MAC_OS_X_VERSION_MIN_REQUIRED */
#else
std::vector<Segment> segments;
// Eigen allocator is needed for alignment of Eigen data types
std::vector<Segment, Eigen::aligned_allocator<Segment> > segments;
#endif
unsigned int nrOfJoints;
unsigned int nrOfSegments;

View File

@@ -27,19 +27,30 @@
#include <string>
#include <map>
#if !defined(__APPLE__)
#include <Eigen/Core>
#if defined(__APPLE__)
# if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_5
//no include
# else
# include <Eigen/Core>
# endif /* MAC_OS_X_VERSION_MIN_REQUIRED */
#else
# include <Eigen/Core>
#endif
namespace KDL
{
//Forward declaration
class TreeElement;
#if !defined(__APPLE__)
#if defined(__APPLE__)
# if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_5
typedef std::map<std::string,TreeElement> SegmentMap;
# else
// Eigen allocator is needed for alignment of Eigen data types
typedef std::map<std::string,TreeElement, std::less<std::string>, Eigen::aligned_allocator<std::pair<std::string, TreeElement> > > SegmentMap;
# endif /* MAC_OS_X_VERSION_MIN_REQUIRED */
#else
typedef std::map<std::string,TreeElement> SegmentMap;
// Eigen allocator is needed for alignment of Eigen data types
typedef std::map<std::string,TreeElement, std::less<std::string>, Eigen::aligned_allocator<std::pair<std::string, TreeElement> > > SegmentMap;
#endif
class TreeElement
{