File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -107,32 +107,7 @@ int dtype::get_itemsize() const {
107107}
108108
109109bool equivalent (dtype const & a, dtype const & b) {
110- // On Windows x64, the behaviour described on
111- // http://docs.scipy.org/doc/numpy/reference/c-api.array.html for
112- // PyArray_EquivTypes unfortunately does not extend as expected:
113- // "For example, on 32-bit platforms, NPY_LONG and NPY_INT are equivalent".
114- // This should also hold for 64-bit platforms (and does on Linux), but not
115- // on Windows. Implement an alternative:
116- #ifdef _MSC_VER
117- if (sizeof (long ) == sizeof (int ) &&
118- // Manually take care of the type equivalence.
119- ((a == dtype::get_builtin<long >() || a == dtype::get_builtin<int >()) &&
120- (b == dtype::get_builtin<long >() || b == dtype::get_builtin<int >()) ||
121- (a == dtype::get_builtin<unsigned int >() || a == dtype::get_builtin<unsigned long >()) &&
122- (b == dtype::get_builtin<unsigned int >() || b == dtype::get_builtin<unsigned long >()))) {
123- return true ;
124- } else {
125- return PyArray_EquivTypes (
126- reinterpret_cast <PyArray_Descr*>(a.ptr ()),
127- reinterpret_cast <PyArray_Descr*>(b.ptr ())
128- );
129- }
130- #else
131- return PyArray_EquivTypes (
132- reinterpret_cast <PyArray_Descr*>(a.ptr ()),
133- reinterpret_cast <PyArray_Descr*>(b.ptr ())
134- );
135- #endif
110+ return a == b;
136111}
137112
138113namespace
You can’t perform that action at this time.
0 commit comments