From 30e42009c03cbb53e3462e1c4ee29af666474742 Mon Sep 17 00:00:00 2001 From: gjaeger1 Date: Wed, 10 Jul 2019 23:30:58 +0200 Subject: Adapting Boost Python library detection to Boost >= 1.67. Closes #4288. --- test cases/frameworks/1 boost/python_module.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test cases/frameworks/1 boost/python_module.cpp (limited to 'test cases/frameworks/1 boost/python_module.cpp') diff --git a/test cases/frameworks/1 boost/python_module.cpp b/test cases/frameworks/1 boost/python_module.cpp new file mode 100644 index 000000000..a0f010b51 --- /dev/null +++ b/test cases/frameworks/1 boost/python_module.cpp @@ -0,0 +1,22 @@ +#define PY_SSIZE_T_CLEAN +#include +#include + +struct World +{ + void set(std::string msg) { this->msg = msg; } + std::string greet() { return msg; } + std::string version() { return std::to_string(PY_MAJOR_VERSION) + "." + std::to_string(PY_MINOR_VERSION); } + std::string msg; +}; + + +BOOST_PYTHON_MODULE(MOD_NAME) +{ + using namespace boost::python; + class_("World") + .def("greet", &World::greet) + .def("set", &World::set) + .def("version", &World::version) + ; +} -- cgit v1.2.3