]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/python/test/voidptr.cpp
1 // Copyright Niall Douglas 2005.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 # include <boost/python/return_opaque_pointer.hpp>
7 # include <boost/python/def.hpp>
8 # include <boost/python/module.hpp>
9 # include <boost/python/return_value_policy.hpp>
11 static void *test
=(void *) 78;
26 throw std::runtime_error(std::string("failed"));
35 namespace bpl
= boost::python
;
37 BOOST_PYTHON_MODULE(voidptr_ext
)
39 bpl::def("get", &::get
, bpl::return_value_policy
<bpl::return_opaque_pointer
>());
40 bpl::def("getnull", &::getnull
, bpl::return_value_policy
<bpl::return_opaque_pointer
>());
41 bpl::def("use", &::use
);
42 bpl::def("useany", &::useany
);