Skip to content

Commit 863e4b1

Browse files
authored
Merge pull request #256 from jcarpent/devel
Fix compatibility with Boost.Python >= 1.77
2 parents aeee16e + 7bb3f89 commit 863e4b1

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

include/eigenpy/eigen-from-python.hpp

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,16 @@ namespace eigenpy
4141
struct referent_storage_eigen_ref
4242
{
4343
typedef Eigen::Ref<MatType,Options,Stride> RefType;
44-
44+
#if BOOST_VERSION / 100 % 1000 >= 77
45+
typedef typename ::boost::python::detail::aligned_storage<
46+
::boost::python::detail::referent_size<RefType&>::value,
47+
::boost::alignment_of<RefType&>::value
48+
>::type AlignedStorage;
49+
#else
4550
typedef ::boost::python::detail::aligned_storage<
4651
::boost::python::detail::referent_size<RefType&>::value
4752
> AlignedStorage;
53+
#endif
4854

4955
referent_storage_eigen_ref()
5056
: pyArray(NULL)
@@ -93,18 +99,22 @@ namespace boost { namespace python { namespace detail {
9399
struct referent_storage<Eigen::Ref<MatType,Options,Stride> &>
94100
{
95101
typedef ::eigenpy::details::referent_storage_eigen_ref<MatType,Options,Stride> StorageType;
96-
typedef aligned_storage<
97-
::boost::python::detail::referent_size<StorageType&>::value
98-
> type;
102+
#if BOOST_VERSION / 100 % 1000 >= 77
103+
typedef typename aligned_storage<referent_size<StorageType&>::value>::type type;
104+
#else
105+
typedef aligned_storage<referent_size<StorageType&>::value> type;
106+
#endif
99107
};
100108

101109
template<typename MatType, int Options, typename Stride>
102110
struct referent_storage<const Eigen::Ref<const MatType,Options,Stride> &>
103111
{
104112
typedef ::eigenpy::details::referent_storage_eigen_ref<const MatType,Options,Stride> StorageType;
105-
typedef aligned_storage<
106-
::boost::python::detail::referent_size<StorageType&>::value
107-
> type;
113+
#if BOOST_VERSION / 100 % 1000 >= 77
114+
typedef typename aligned_storage<referent_size<StorageType&>::value, alignment_of<StorageType&>::value>::type type;
115+
#else
116+
typedef aligned_storage<referent_size<StorageType&>::value> type;
117+
#endif
108118
};
109119
#endif
110120
}}}

0 commit comments

Comments
 (0)