itask: reworked conditionals for osx version compatibility
authorJens Verwiebe <info@jensverwiebe.de>
Wed, 7 Nov 2012 21:19:43 +0000 (21:19 +0000)
committerJens Verwiebe <info@jensverwiebe.de>
Wed, 7 Nov 2012 21:19:43 +0000 (21:19 +0000)
intern/itasc/kdl/chain.hpp
intern/itasc/kdl/tree.hpp

index 24e40858bff7b23c64046a1ccec39458aae9a31e..fde9d4ed23ee8b1f5d892758ae9f443f943c8b1e 100644 (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;
index 4da764ac6d62f97fbee8d6564b7c3bba2fc08a21..a020c6cf2cf3623acf905367732bc212f89dcfba 100644 (file)
 
 #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
     {