Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error: redefinition of ‘struct eigenpy::NumpyEquivalentType<... #488

Merged
merged 5 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Fixed
- Remove CMake CMP0167 warnings ([#487](https://github.com/stack-of-tasks/eigenpy/pull/487))
- Fix compilation error on armhf ([#488](https://github.com/stack-of-tasks/eigenpy/pull/488))

## [3.7.0] - 2024-06-11

Expand Down
17 changes: 12 additions & 5 deletions include/eigenpy/numpy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void EIGENPY_DLLAPI import_numpy();
int EIGENPY_DLLAPI PyArray_TypeNum(PyTypeObject* type);

// By default, the Scalar is considered as a Python object
template <typename Scalar>
template <typename Scalar, typename Enable = void>
struct NumpyEquivalentType {
enum { type_code = NPY_USERDEF };
};
Expand Down Expand Up @@ -139,12 +139,19 @@ struct NumpyEquivalentType<unsigned long> {
// See https://github.com/stack-of-tasks/eigenpy/pull/455
#if defined __linux__

template <>
struct NumpyEquivalentType<long long> {
#include <type_traits>

template <typename Scalar>
struct NumpyEquivalentType<
Scalar, std::enable_if_t<!std::is_same<int64_t, long long>::value &&
std::is_same<Scalar, long long>::value> > {
enum { type_code = NPY_LONGLONG };
};
template <>
struct NumpyEquivalentType<unsigned long long> {
template <typename Scalar>
struct NumpyEquivalentType<
Scalar,
std::enable_if_t<!std::is_same<uint64_t, unsigned long long>::value &&
std::is_same<Scalar, unsigned long long>::value> > {
enum { type_code = NPY_ULONGLONG };
};

Expand Down
Loading