File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 2626* .exe
2727* .out
2828* .app
29+
30+ # Logfiles
31+ * .tlog
32+ * .log
Original file line number Diff line number Diff line change 1010#include < functional>
1111#endif
1212
13+ #ifdef PY_INCLUDE
14+ #include < Python.h>
15+ #else
1316#include < python2.7/Python.h>
17+ #endif
18+
19+ #if PY_MAJOR_VERSION >= 3
20+ #define PyString_FromString PyUnicode_FromString
21+ #endif
22+
1423
1524namespace matplotlibcpp {
1625
@@ -48,8 +57,14 @@ namespace matplotlibcpp {
4857
4958 private:
5059 _interpreter () {
51- char name[] = " plotting" ; // silence compiler warning about const strings
52- Py_SetProgramName (name); // optional but recommended
60+
61+ // optional but recommended
62+ #if PY_MAJOR_VERSION >= 3
63+ wchar_t name[] = L" plotting" ;
64+ #else
65+ char name[] = " plotting" ;
66+ #endif
67+ Py_SetProgramName (name);
5368 Py_Initialize ();
5469
5570 PyObject* pyplotname = PyString_FromString (" matplotlib.pyplot" );
@@ -62,7 +77,7 @@ namespace matplotlibcpp {
6277
6378 PyObject* pylabmod = PyImport_Import (pylabname);
6479 Py_DECREF (pylabname);
65- if (!pymod ) { throw std::runtime_error (" Error loading module pylab!" ); }
80+ if (!pylabmod ) { throw std::runtime_error (" Error loading module pylab!" ); }
6681
6782 s_python_function_show = PyObject_GetAttrString (pymod, " show" );
6883 s_python_function_figure = PyObject_GetAttrString (pymod, " figure" );
You can’t perform that action at this time.
0 commit comments