Skip to content

Commit 7566e3d

Browse files
authored
Update matplotlibcpp.h
1 parent 999b9c2 commit 7566e3d

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

matplotlibcpp.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,13 +348,19 @@ template <> struct select_npy_type<uint16_t> { const static NPY_TYPES type = NPY
348348
template <> struct select_npy_type<uint32_t> { const static NPY_TYPES type = NPY_ULONG; };
349349
template <> struct select_npy_type<uint64_t> { const static NPY_TYPES type = NPY_UINT64; };
350350

351-
// Sanity checks; comment them out or change the numpy type below if you're compiling on
352-
// a platform where they don't apply
351+
#ifndef DISABLE_TYPE_SIZE_SANITY_CHECK
352+
// Sanity checks; comment them out or change the numpy type below if you're
353+
// compiling on a platform where they don't apply
353354
static_assert(sizeof(long long) == 8, "size check failed");
354-
template <> struct select_npy_type<long long> { const static NPY_TYPES type = NPY_INT64; };
355+
template <> struct select_npy_type<long long> {
356+
const static NPY_TYPES type = NPY_INT64;
357+
};
355358
static_assert(sizeof(unsigned long long) == 8, "size check failed");
356-
template <> struct select_npy_type<unsigned long long> { const static NPY_TYPES type = NPY_UINT64; };
357-
359+
template <> struct select_npy_type<unsigned long long> {
360+
const static NPY_TYPES type = NPY_UINT64;
361+
};
362+
#endif
363+
358364
template<typename Numeric>
359365
PyObject* get_array(const std::vector<Numeric>& v)
360366
{

0 commit comments

Comments
 (0)