From 56a5ff76abaf2d84e12a78750f28ff55da587b8b Mon Sep 17 00:00:00 2001 From: Christopher Bednarz Date: Thu, 23 Jul 2020 13:19:52 -0700 Subject: [PATCH 1/2] static_assert messages now include a message to comply with the C++11 standard. --- matplotlibcpp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matplotlibcpp.h b/matplotlibcpp.h index 67700740..20e1ce00 100644 --- a/matplotlibcpp.h +++ b/matplotlibcpp.h @@ -312,9 +312,9 @@ template <> struct select_npy_type { const static NPY_TYPES type = NPY // Sanity checks; comment them out or change the numpy type below if you're compiling on // a platform where they don't apply -static_assert(sizeof(long long) == 8); +static_assert(sizeof(long long) == 8, "sizeof(long long) must be equal to 8."); template <> struct select_npy_type { const static NPY_TYPES type = NPY_INT64; }; -static_assert(sizeof(unsigned long long) == 8); +static_assert(sizeof(unsigned long long) == 8, "sizeof(unsigned long long) must be equal to 8."); template <> struct select_npy_type { const static NPY_TYPES type = NPY_UINT64; }; // TODO: add int, long, etc. From 84ed07bfdc8491dc2958582164281c57d24be439 Mon Sep 17 00:00:00 2001 From: Christopher Bednarz Date: Thu, 23 Jul 2020 13:20:27 -0700 Subject: [PATCH 2/2] Added default Argv value to Python initialization to fix potential runtime_error failures. --- matplotlibcpp.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/matplotlibcpp.h b/matplotlibcpp.h index 20e1ce00..552a8653 100644 --- a/matplotlibcpp.h +++ b/matplotlibcpp.h @@ -152,6 +152,10 @@ struct _interpreter { #endif Py_SetProgramName(name); Py_Initialize(); + + wchar_t* args[1]; + args[0] = Py_DecodeLocale("", NULL); + PySys_SetArgv(0, args); #ifndef WITHOUT_NUMPY import_numpy(); // initialize numpy C-API