diff --git a/src/debug_lldb.cpp b/src/debug_lldb.cpp index 5266df4..08f45e9 100644 --- a/src/debug_lldb.cpp +++ b/src/debug_lldb.cpp @@ -10,6 +10,7 @@ #include "utility.hpp" #include #include +#include extern char **environ; diff --git a/src/plugins.h b/src/plugins.h index 1b5079f..39f38a0 100644 --- a/src/plugins.h +++ b/src/plugins.h @@ -1,26 +1,7 @@ #pragma once #include "python_interpreter.h" -#include #include -namespace pybind11 { - namespace detail { - template <> - struct type_caster { - public: - PYBIND11_TYPE_CASTER(boost::filesystem::path, _("str")); - bool load(handle src, bool) { - value = std::string(pybind11::str(src)); - return !PyErr_Occurred(); - } - - static handle cast(boost::filesystem::path src, return_value_policy, handle) { - return pybind11::str(src.string()); - } - }; - } // namespace detail -} // namespace pybind11 - class __attribute__((visibility("default"))) Plugins { public: diff --git a/src/python_type_casters.h b/src/python_type_casters.h new file mode 100644 index 0000000..42d0503 --- /dev/null +++ b/src/python_type_casters.h @@ -0,0 +1,21 @@ +#pragma once +#include "python_bind.h" +#include + +namespace pybind11 { + namespace detail { + template <> + struct type_caster { + public: + PYBIND11_TYPE_CASTER(boost::filesystem::path, _("str")); + bool load(handle src, bool) { + value = std::string(pybind11::str(src)); + return !PyErr_Occurred(); + } + + static handle cast(boost::filesystem::path src, return_value_policy, handle) { + return pybind11::str(src.string()); + } + }; + } // namespace detail +} // namespace pybind11 diff --git a/tests/python_interpreter_test.cc b/tests/python_interpreter_test.cc index 0fdabaa..7376a51 100644 --- a/tests/python_interpreter_test.cc +++ b/tests/python_interpreter_test.cc @@ -3,6 +3,7 @@ #include "python_interpreter.h" #include "terminal.h" #include "config.h" +#include "python_type_casters.h" class __attribute__((visibility("default"))) diff --git a/tests/python_interpreter_test_files/terminal_test.py b/tests/python_interpreter_test_files/terminal_test.py index e2d3736..d8151d6 100644 --- a/tests/python_interpreter_test_files/terminal_test.py +++ b/tests/python_interpreter_test_files/terminal_test.py @@ -1,6 +1,6 @@ from Jucipp import Terminal -t = Terminal(); +t = Terminal() def hello_world(): t.print("Hello, World!\n")