From 5cd513859dcf03babb2b2c914dba03fcd964c264 Mon Sep 17 00:00:00 2001
From: Dave Abrahams C++ code:C++ Module Definition
-#include <boost/python/module_init.hpp>
+#include <boost/python/module.hpp>
#include <boost/python/class.hpp>
#include <boost/utility.hpp>
#include <cstring>
@@ -119,7 +119,7 @@ class Base_callback : public Base
};
using namespace boost::python;
-BOOST_PYTHON_MODULE_INIT(my_module)
+BOOST_PYTHON_MODULE(my_module)
{
def("is_base", is_base);
diff --git a/doc/v2/copy_const_reference.html b/doc/v2/copy_const_reference.html
index 41a9b9ab..a014ee28 100644
--- a/doc/v2/copy_const_reference.html
+++ b/doc/v2/copy_const_reference.html
@@ -98,7 +98,7 @@ template <class T> struct apply
C++ Module Definition
-#include <boost/python/module_init.hpp>
+#include <boost/python/module.hpp>
#include <boost/python/class.hpp>
#include <boost/python/copy_const_reference.hpp>
#include <boost/python/return_value_policy.hpp>
@@ -115,7 +115,7 @@ struct Foo {
// Wrapper code
using namespace boost::python;
-BOOST_PYTHON_MODULE_INIT(my_module)
+BOOST_PYTHON_MODULE(my_module)
{
class_<Bar>("Bar");
diff --git a/doc/v2/copy_non_const_reference.html b/doc/v2/copy_non_const_reference.html
index 0169fff1..ac796a21 100644
--- a/doc/v2/copy_non_const_reference.html
+++ b/doc/v2/copy_non_const_reference.html
@@ -99,7 +99,7 @@ template <class T> struct apply
-#include <boost/python/module_init.hpp>
+#include <boost/python/module.hpp>
#include <boost/python/class.hpp>
#include <boost/python/copy_non_const_reference.hpp>
#include <boost/python/return_value_policy.hpp>
@@ -116,7 +116,7 @@ struct Foo {
// Wrapper code
using namespace boost::python;
-BOOST_PYTHON_MODULE_INIT(my_module)
+BOOST_PYTHON_MODULE(my_module)
{
class_<Bar>("Bar");
diff --git a/doc/v2/data_members.html b/doc/v2/data_members.html
index eabf8183..5ec6ff01 100644
--- a/doc/v2/data_members.html
+++ b/doc/v2/data_members.html
@@ -115,7 +115,7 @@ template <class C, class D, class Policies>
member as functions:
#include <boost/python/data_members.hpp>
-#include <boost/python/module_init.hpp>
+#include <boost/python/module.hpp>
#include <boost/python/class.hpp>
struct X
diff --git a/doc/v2/exception_translator.html b/doc/v2/exception_translator.html
index 9178d05c..407ff95d 100644
--- a/doc/v2/exception_translator.html
+++ b/doc/v2/exception_translator.html
@@ -97,7 +97,7 @@ void f(ExceptionType x) { translate(x); }
Example
-#include <boost/python/module_init.hpp>
+#include <boost/python/module.hpp>
#include <boost/python/def.hpp>
#include <boost/python/exception_translator.hpp>
#include <exception>
@@ -120,7 +120,7 @@ void something_which_throws()
...
}
-BOOST_PYTHON_MODULE_INIT(exception_translator_ext)
+BOOST_PYTHON_MODULE(exception_translator_ext)
{
using namespace boost::python;
register_exception_translator<my_exception>(&translate);
diff --git a/doc/v2/extract.html b/doc/v2/extract.html
index 98d52d69..5ce2aec2 100644
--- a/doc/v2/extract.html
+++ b/doc/v2/extract.html
@@ -204,7 +204,7 @@ struct X
int v;
};
-BOOST_PYTHON_MODULE_INIT(extract_ext)
+BOOST_PYTHON_MODULE(extract_ext)
{
object x_class(
class_<X>("X", init<int>())
diff --git a/doc/v2/has_back_reference.html b/doc/v2/has_back_reference.html
index 7e3a8609..0a2f54ce 100644
--- a/doc/v2/has_back_reference.html
+++ b/doc/v2/has_back_reference.html
@@ -111,7 +111,7 @@ namespace boost { namespace python
C++ module definition
#include <boost/python/class.hpp>
-#include <boost/python/module_init.hpp>
+#include <boost/python/module.hpp>
#include <boost/python/has_back_reference.hpp>
#include <boost/python/handle.hpp>
#include <boost/shared_ptr.hpp>
@@ -153,7 +153,7 @@ struct Y
boost::shared_ptr<Y> Y_self(boost::shared_ptr<Y> self) const { return self; }
-BOOST_PYTHON_MODULE_INIT(back_references)
+BOOST_PYTHON_MODULE(back_references)
{
class_<X>("X")
.def(init<int>())
diff --git a/doc/v2/implicit.html b/doc/v2/implicit.html
index aebe2b52..ea24c567 100644
--- a/doc/v2/implicit.html
+++ b/doc/v2/implicit.html
@@ -103,7 +103,7 @@ void implicitly_convertible();
#include <boost/python/class.hpp>
#include <boost/python/implicit.hpp>
-#include <boost/python/module_init.hpp>
+#include <boost/python/module.hpp>
using namespace boost::python;
@@ -121,7 +121,7 @@ int x_value(X const& x)
X make_x(int n) { return X(n); }
-BOOST_PYTHON_MODULE_INIT(implicit_ext)
+BOOST_PYTHON_MODULE(implicit_ext)
{
def("x_value", x_value);
def("make_x", make_x);
diff --git a/doc/v2/iterator.html b/doc/v2/iterator.html
index 3388d913..03d0cb00 100644
--- a/doc/v2/iterator.html
+++ b/doc/v2/iterator.html
@@ -355,13 +355,13 @@ template <class Accessor1, class Accessor2>
Examples
-#include <boost/python/module_init.hpp>
+#include <boost/python/module.hpp>
#include <boost/python/class.hpp>
#include <vector>
using namespace boost::python;
-BOOST_PYTHON_MODULE_INIT(demo)
+BOOST_PYTHON_MODULE(demo)
{
class_<std::vector<double> >("dvec")
.def("__iter__", iterator<std::vector<double> >())
diff --git a/doc/v2/lvalue_from_pytype.html b/doc/v2/lvalue_from_pytype.html
index 57997b3a..74b18f06 100755
--- a/doc/v2/lvalue_from_pytype.html
+++ b/doc/v2/lvalue_from_pytype.html
@@ -239,7 +239,7 @@ static MemberType& execute(InstanceType& c);
C++ module definition
#include <boost/python/reference.hpp>
-#include <boost/python/module_init.hpp>
+#include <boost/python/module.hpp>
// definition lifted from the Python docs
typedef struct {
@@ -259,7 +259,7 @@ void set_cache(noddy_NoddyObject* x)
cache.reset((PyObject*)x, ref::increment_count);
}
-BOOST_PYTHON_MODULE_INIT(noddy_cache)
+BOOST_PYTHON_MODULE(noddy_cache)
{
def("is_cached", is_cached);
def("set_cache", set_cache);
diff --git a/doc/v2/make_function.html b/doc/v2/make_function.html
index 0d7bb689..080f95c7 100644
--- a/doc/v2/make_function.html
+++ b/doc/v2/make_function.html
@@ -138,7 +138,7 @@ template <class ArgList, class Generator, class Policies>
two functions.
#include <boost/python/make_function.hpp>
-#include <boost/python/module_init.hpp>
+#include <boost/python/module.hpp>
char const* foo() { return "foo"; }
char const* bar() { return "bar"; }
@@ -152,7 +152,7 @@ object choose_function(bool selector)
return boost::python::make_function(bar);
}
-BOOST_PYTHON_MODULE_INIT(make_function_test)
+BOOST_PYTHON_MODULE(make_function_test)
{
def("choose_function", choose_function);
}
diff --git a/doc/v2/manage_new_object.html b/doc/v2/manage_new_object.html
index f6b6168d..c76a3a4d 100644
--- a/doc/v2/manage_new_object.html
+++ b/doc/v2/manage_new_object.html
@@ -97,7 +97,7 @@ template <class T> struct apply
In C++:
-#include <boost/python/module_init.hpp>
+#include <boost/python/module.hpp>
#include <boost/python/class.hpp>
#include <boost/python/manage_new_object.hpp>
#include <boost/python/return_value_policy.hpp>
@@ -113,7 +113,7 @@ Foo* make_foo(int x) { return new Foo(x); }
// Wrapper code
using namespace boost::python;
-BOOST_PYTHON_MODULE_INIT(my_module)
+BOOST_PYTHON_MODULE(my_module)
{
def("make_foo", make_foo, return_value_policy<manage_new_object>())
class_<Foo>("Foo")
diff --git a/doc/v2/module.html b/doc/v2/module.html
index 3685934c..4b3017bc 100644
--- a/doc/v2/module.html
+++ b/doc/v2/module.html
@@ -29,7 +29,7 @@
BOOST_PYTHON_MODULE_INIT(name)
+ "BOOST_PYTHON_MODULE-spec">BOOST_PYTHON_MODULE(name)
is used to declare Python
module initialization functions. The name argument must
@@ -81,7 +81,7 @@ void initname()
Boost.Python modules should be initialized with
-BOOST_PYTHON_MODULE_INIT(name)
+BOOST_PYTHON_MODULE(name)
{
...
@@ -134,7 +134,7 @@ module(const char* name);
name is a ntbs whose value matches the
argument passed to BOOST_PYTHON_MODULE_INIT.
+ "#BOOST_PYTHON_MODULE-spec">BOOST_PYTHON_MODULE.
module object representing a
Python module named name.
@@ -238,7 +238,7 @@ char const* greet()
return "hello, Boost.Python!";
}
-BOOST_PYTHON_MODULE_INIT(boost_greet)
+BOOST_PYTHON_MODULE(boost_greet)
{
module("boost_greet")
.def("greet", greet);
diff --git a/doc/v2/operators.html b/doc/v2/operators.html
index 6a551b92..307e949b 100755
--- a/doc/v2/operators.html
+++ b/doc/v2/operators.html
@@ -809,7 +809,7 @@ namespace boost { namespace python
-#include <boost/python/module_init.hpp>
+#include <boost/python/module.hpp>
#include <boost/python/class.hpp>
#include <boost/python/operators.hpp>
#include <boost/operators.hpp>
@@ -836,7 +836,7 @@ struct number
};
using namespace boost::python;
-BOOST_PYTHON_MODULE_INIT(demo)
+BOOST_PYTHON_MODULE(demo)
{
class_<number>("number")
// interoperate with self
diff --git a/doc/v2/reference_existing_object.html b/doc/v2/reference_existing_object.html
index 624bfc08..88016dd8 100644
--- a/doc/v2/reference_existing_object.html
+++ b/doc/v2/reference_existing_object.html
@@ -113,7 +113,7 @@ template <class T> struct apply
In C++:
-#include <boost/python/module_init.hpp>
+#include <boost/python/module.hpp>
#include <boost/python/class.hpp>
#include <boost/python/reference_existing_object.hpp>
#include <boost/python/return_value_policy.hpp>
@@ -141,7 +141,7 @@ Singleton& get_it()
// Wrapper code
using namespace boost::python;
-BOOST_PYTHON_MODULE_INIT(singleton)
+BOOST_PYTHON_MODULE(singleton)
{
def("get_it", get_it, reference_existing_object());
class_<Singleton>("Singleton")
diff --git a/doc/v2/return_internal_reference.html b/doc/v2/return_internal_reference.html
index f2b032a8..79c60abb 100644
--- a/doc/v2/return_internal_reference.html
+++ b/doc/v2/return_internal_reference.html
@@ -158,7 +158,7 @@ PyObject* postcall(PyObject* args, PyObject* result);
C++ module definition
-#include <boost/python/module_init.hpp>
+#include <boost/python/module.hpp>
#include <boost/python/class.hpp>
#include <boost/python/return_internal_reference.hpp>
@@ -184,7 +184,7 @@ class Foo
};
using namespace boost::python;
-BOOST_PYTHON_MODULE_INIT(internal_refs)
+BOOST_PYTHON_MODULE(internal_refs)
{
class_<Bar>("Bar")
.def("get_x", &Bar::get_x)
diff --git a/doc/v2/return_value_policy.html b/doc/v2/return_value_policy.html
index 8f5d779d..1482d6e8 100644
--- a/doc/v2/return_value_policy.html
+++ b/doc/v2/return_value_policy.html
@@ -116,7 +116,7 @@ namespace boost { namespace python
C++ Module Definition
-#include <boost/python/module_init.hpp>
+#include <boost/python/module.hpp>
#include <boost/python/class.hpp>
#include <boost/python/copy_const_reference.hpp>
#include <boost/python/return_value_policy.hpp>
@@ -133,7 +133,7 @@ struct Foo {
// Wrapper code
using namespace boost::python;
-BOOST_PYTHON_MODULE_INIT(my_module)
+BOOST_PYTHON_MODULE(my_module)
{
class_<Bar>("Bar");
diff --git a/doc/v2/to_python_converter.html b/doc/v2/to_python_converter.html
index f6682242..757d9f0e 100644
--- a/doc/v2/to_python_converter.html
+++ b/doc/v2/to_python_converter.html
@@ -143,7 +143,7 @@ to_python_converter();
C++ module definition
#include <boost/python/reference.hpp>
-#include <boost/python/module_init.hpp>
+#include <boost/python/module.hpp>
#include "noddy.h"
struct tag {};
@@ -159,7 +159,7 @@ struct tag_to_noddy
}
};
-BOOST_PYTHON_MODULE_INIT(to_python_converter)
+BOOST_PYTHON_MODULE(to_python_converter)
{
def("make_tag", make_tag);
to_python_converter<tag, tag_to_noddy>();
diff --git a/include/boost/python/class.hpp b/include/boost/python/class.hpp
index 2e0840b3..3ec153b4 100644
--- a/include/boost/python/class.hpp
+++ b/include/boost/python/class.hpp
@@ -13,7 +13,6 @@
# include
# include
-# include
# include
# include
# include
@@ -25,17 +24,19 @@
# include
# include
# include
-# include
# include
# include
# include
-# include
-# include
-# include
# include
# include
# include
+# include
+# include
+# include
+# include
+# include
+
namespace boost { namespace python {
enum no_init_t { no_init };
diff --git a/include/boost/python/def.hpp b/include/boost/python/def.hpp
index f6218886..5631fb56 100644
--- a/include/boost/python/def.hpp
+++ b/include/boost/python/def.hpp
@@ -9,7 +9,7 @@
# include
# include
# include
-# include
+# include
# include
# include
# include
diff --git a/include/boost/python/detail/defaults_def.hpp b/include/boost/python/detail/defaults_def.hpp
index d7262316..7062283e 100644
--- a/include/boost/python/detail/defaults_def.hpp
+++ b/include/boost/python/detail/defaults_def.hpp
@@ -219,7 +219,7 @@ namespace detail
char const* name,
OverloadsT const& overloads,
NameSpaceT& name_space,
- SigT sig)
+ SigT const& sig)
{
typedef typename mpl::front::type return_type;
typedef typename OverloadsT::void_return_type void_return_type;
diff --git a/include/boost/python/init.hpp b/include/boost/python/init.hpp
index 35f2dc90..6727135b 100644
--- a/include/boost/python/init.hpp
+++ b/include/boost/python/init.hpp
@@ -12,6 +12,8 @@
#include
#include
+#include
+
#include
#include
#include
diff --git a/include/boost/python/module.hpp b/include/boost/python/module.hpp
index 69e9001d..d259d2da 100644
--- a/include/boost/python/module.hpp
+++ b/include/boost/python/module.hpp
@@ -6,104 +6,7 @@
#ifndef MODULE_DWA2001128_HPP
# define MODULE_DWA2001128_HPP
-# include
-# include
-# include
-# include
-# include
# include
-# include
-# include
-# include
-# include
-
-namespace boost { namespace python {
-
-class module : public detail::module_base
-{
- public:
- typedef detail::module_base base;
-
- module(char const* name, char const* doc = 0)
- : base(name, doc) {}
-
- // Add elements to the module
- template
- module& setattr(const char* name, T const& x)
- {
- this->base::setattr_doc(name, python::object(x), 0);
- return *this;
- }
-
- module& add(type_handle x); // just use the type's name
-
- template
- module& add(class_ const& c)
- {
- // Soon to disappear...
- return *this;
- }
-
- template
- module& def(char const* name, Fn fn)
- {
- this->setattr_doc(
- name, boost::python::make_function(fn), 0);
-
- return *this;
- }
-
- template
- module& def(char const* name, Arg1T arg1, Arg2T const& arg2, char const* doc = 0)
- {
- dispatch_def(name, arg1, arg2, doc, &arg2);
- return *this;
- }
-
- private:
-
- template
- void
- dispatch_def(
- char const* name,
- Fn fn,
- CallPolicyOrDoc const& policy_or_doc,
- char const* doc,
- void const*)
- {
- detail::def_helper helper(policy_or_doc, doc);
-
- this->setattr_doc(
- name
- , boost::python::make_function(fn, helper.policies())
- , helper.doc());
- }
-
- template
- void
- dispatch_def(
- char const* name,
- SigT sig,
- StubsT const& stubs,
- char const* doc,
- detail::overloads_base const*)
- {
- // convert sig to a type_list (see detail::get_signature in signature.hpp)
- // before calling detail::define_with_defaults.
- detail::define_with_defaults(
- name, stubs, *this, detail::get_signature(sig));
- }
-};
-
-//
-// inline implementations
-//
-inline module& module::add(type_handle x)
-{
- this->base::add(x);
- return *this;
-}
-
-}} // namespace boost::python
+# define BOOST_PYTHON_MODULE BOOST_PYTHON_MODULE_INIT
#endif // MODULE_DWA20011221_HPP
diff --git a/src/aix_init_module.cpp b/src/aix_init_module.cpp
index 3d74596e..2345aa4f 100644
--- a/src/aix_init_module.cpp
+++ b/src/aix_init_module.cpp
@@ -17,7 +17,7 @@ extern "C"
# include
# include
# include
-# include
+# include
namespace boost { namespace python { namespace detail {
diff --git a/test/args.cpp b/test/args.cpp
index ee79fcfa..281ca236 100644
--- a/test/args.cpp
+++ b/test/args.cpp
@@ -3,11 +3,12 @@
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
-#include
+#include
#include
#include
#include
#include
+#include
#include
#include "test_class.hpp"
@@ -38,7 +39,7 @@ struct X
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_f_overloads, X::f, 0, 3)
-BOOST_PYTHON_MODULE_INIT(args_ext)
+BOOST_PYTHON_MODULE(args_ext)
{
def("f", f, args("x", "y", "z")
, "This is f's docstring"
diff --git a/test/back_reference.cpp b/test/back_reference.cpp
index d5ae5ece..75233c6b 100644
--- a/test/back_reference.cpp
+++ b/test/back_reference.cpp
@@ -4,7 +4,7 @@
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#include
-#include
+#include
#include
#include
#include
@@ -87,7 +87,7 @@ bool y_equality(back_reference y1, Y const& y2)
return &y1.get() == &y2;
}
-BOOST_PYTHON_MODULE_INIT(back_reference_ext)
+BOOST_PYTHON_MODULE(back_reference_ext)
{
def("copy_Y", copy_Y, return_value_policy());
def("copy_Z", copy_Z, return_value_policy());
diff --git a/test/bienstman1.cpp b/test/bienstman1.cpp
index b4acf059..7f1736e0 100644
--- a/test/bienstman1.cpp
+++ b/test/bienstman1.cpp
@@ -1,4 +1,4 @@
-#include
+#include
#include
#include
#include
@@ -18,7 +18,7 @@ struct V
const A* outside(const V& v) {return &v.a;}
-BOOST_PYTHON_MODULE_INIT(bienstman1_ext)
+BOOST_PYTHON_MODULE(bienstman1_ext)
{
using namespace boost::python;
using boost::shared_ptr;
diff --git a/test/bienstman2.cpp b/test/bienstman2.cpp
index 7e4f951c..94f2a8c3 100644
--- a/test/bienstman2.cpp
+++ b/test/bienstman2.cpp
@@ -1,4 +1,4 @@
-#include
+#include
#include
#include
@@ -15,7 +15,7 @@ struct E
const D fe2(const C&, const C&) {return D();}
};
-BOOST_PYTHON_MODULE_INIT(bienstman2_ext)
+BOOST_PYTHON_MODULE(bienstman2_ext)
{
using namespace boost::python;
diff --git a/test/bienstman3.cpp b/test/bienstman3.cpp
index 22c7638e..9248ef8f 100644
--- a/test/bienstman3.cpp
+++ b/test/bienstman3.cpp
@@ -1,4 +1,4 @@
-#include
+#include
#include
#include
@@ -12,7 +12,7 @@ struct B
B(const V&) {}
};
-BOOST_PYTHON_MODULE_INIT(bienstman3_ext)
+BOOST_PYTHON_MODULE(bienstman3_ext)
{
using namespace boost::python;
diff --git a/test/bienstman4.cpp b/test/bienstman4.cpp
index ee510f2d..124d76a5 100644
--- a/test/bienstman4.cpp
+++ b/test/bienstman4.cpp
@@ -4,7 +4,7 @@
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
-#include
+#include
#include
#include
#include
@@ -16,7 +16,7 @@ struct Term {Term(Type1 const&) {} };
struct Expression {void add(Term const&) {} };
-BOOST_PYTHON_MODULE_INIT(bienstman4_ext)
+BOOST_PYTHON_MODULE(bienstman4_ext)
{
using namespace boost::python;
using boost::mpl::list;
diff --git a/test/bienstman5.cpp b/test/bienstman5.cpp
index 75fbd8da..72875663 100644
--- a/test/bienstman5.cpp
+++ b/test/bienstman5.cpp
@@ -4,7 +4,7 @@
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
-#include
+#include
#include
#include
#include
@@ -13,7 +13,7 @@
struct M {M(const std::complex&) {} };
-BOOST_PYTHON_MODULE_INIT(bienstman5_ext)
+BOOST_PYTHON_MODULE(bienstman5_ext)
{
using namespace boost::python;
diff --git a/test/callbacks.cpp b/test/callbacks.cpp
index 763dcda8..036c532a 100644
--- a/test/callbacks.cpp
+++ b/test/callbacks.cpp
@@ -3,7 +3,7 @@
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
-#include
+#include
#include
//#include
#include
@@ -113,7 +113,7 @@ object apply_object_object(PyObject* f, object x)
int X::counter;
-BOOST_PYTHON_MODULE_INIT(callbacks_ext)
+BOOST_PYTHON_MODULE(callbacks_ext)
{
def("apply_object_object", apply_object_object);
def("apply_to_own_type", apply_to_own_type);
diff --git a/test/cltree.cpp b/test/cltree.cpp
index f7ea9eeb..099d5cb7 100755
--- a/test/cltree.cpp
+++ b/test/cltree.cpp
@@ -1,4 +1,4 @@
-#include
+#include
#include
#include
#include
@@ -49,7 +49,7 @@ public:
};
-BOOST_PYTHON_MODULE_INIT(cltree)
+BOOST_PYTHON_MODULE(cltree)
{
boost::python::class_("basic")
.def("__repr__",&basic::repr)
diff --git a/test/comprehensive.cpp b/test/comprehensive.cpp
index be638066..e3a756b9 100644
--- a/test/comprehensive.cpp
+++ b/test/comprehensive.cpp
@@ -1196,7 +1196,7 @@ PyObject* raw(const boost::python::tuple& args, const boost::python::dictionary&
return BOOST_PYTHON_CONVERSION::to_python(first->i_ + second + third + fourth);
}
-BOOST_PYTHON_MODULE_INIT(boost_python_test)
+BOOST_PYTHON_MODULE(boost_python_test)
{
boost::python::module_builder boost_python_test("boost_python_test");
init_module(boost_python_test);
diff --git a/test/data_members.cpp b/test/data_members.cpp
index 7a05d359..2345634a 100644
--- a/test/data_members.cpp
+++ b/test/data_members.cpp
@@ -4,7 +4,7 @@
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#include
-#include
+#include
#include "test_class.hpp"
#if defined(_AIX) && defined(__EDG_VERSION__) && __EDG_VERSION__ < 245
@@ -20,7 +20,7 @@ typedef test_class<1> Y;
double get_fair_value(X const& x) { return x.value(); }
-BOOST_PYTHON_MODULE_INIT(data_members_ext)
+BOOST_PYTHON_MODULE(data_members_ext)
{
class_("X", init())
.def("value", &X::value)
diff --git a/test/defaults.cpp b/test/defaults.cpp
index 41341e72..1c173a79 100644
--- a/test/defaults.cpp
+++ b/test/defaults.cpp
@@ -5,11 +5,11 @@
// to its suitability for any purpose.
#include
-#include
+#include
#include
#include
#include
-#include
+#include
#include
#if defined(_AIX) && defined(__EDG_VERSION__) && __EDG_VERSION__ < 245
@@ -147,17 +147,11 @@ BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_foo_3_stubs, foo, 2, 3)
///////////////////////////////////////////////////////////////////////////////
-BOOST_PYTHON_MODULE_INIT(defaults_ext)
+BOOST_PYTHON_MODULE(defaults_ext)
{
def("foo", foo, foo_stubs());
def("bar", (object(*)(int, char, std::string, double))0, bar_stubs());
- // Show that this works with the old obsolete module version of def().
- module("defaults_ext")
- .def("foobar", foo, foo_stubs())
- .def("barfoo", (object(*)(int, char, std::string, double))0, bar_stubs())
- ;
-
class_("Y", init<>("doc of Y init")) // this should work
.def("get_state", &Y::get_state)
;
diff --git a/test/dict.cpp b/test/dict.cpp
index 0850c6be..538c7930 100644
--- a/test/dict.cpp
+++ b/test/dict.cpp
@@ -1,4 +1,4 @@
-#include
+#include
#include
#include
#include
@@ -68,7 +68,7 @@ void test_templates(object print)
//print(tmp[3]);
}
-BOOST_PYTHON_MODULE_INIT(dict_ext)
+BOOST_PYTHON_MODULE(dict_ext)
{
def("new_dict", new_dict);
def("data_dict", data_dict);
diff --git a/test/docstring.cpp b/test/docstring.cpp
index 417a6635..65893d02 100644
--- a/test/docstring.cpp
+++ b/test/docstring.cpp
@@ -6,7 +6,7 @@
#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -30,7 +30,7 @@ unsigned long fact(unsigned long n)
return n <= 1 ? n : n * fact(n - 1);
}
-BOOST_PYTHON_MODULE_INIT(docstring_ext)
+BOOST_PYTHON_MODULE(docstring_ext)
{
scope().attr("__doc__") =
"A simple test module for documentation strings\n"
diff --git a/test/enum.cpp b/test/enum.cpp
index d6147bc0..b0dd02ae 100644
--- a/test/enum.cpp
+++ b/test/enum.cpp
@@ -5,7 +5,7 @@
// to its suitability for any purpose.
#include
#include
-#include
+#include
using namespace boost::python;
@@ -13,7 +13,7 @@ enum color { red = 1, green = 2, blue = 4 };
color identity_(color x) { return x; }
-BOOST_PYTHON_MODULE_INIT(enum_ext)
+BOOST_PYTHON_MODULE(enum_ext)
{
enum_("color")
.value("red", red)
diff --git a/test/exception_translator.cpp b/test/exception_translator.cpp
index 8a6428fd..f9c38ab9 100644
--- a/test/exception_translator.cpp
+++ b/test/exception_translator.cpp
@@ -1,4 +1,4 @@
-#include
+#include
#include
#include
@@ -15,7 +15,7 @@ void throw_error()
}
-BOOST_PYTHON_MODULE_INIT(exception_translator_ext)
+BOOST_PYTHON_MODULE(exception_translator_ext)
{
using namespace boost::python;
register_exception_translator(&translate);
diff --git a/test/extract.cpp b/test/extract.cpp
index 2faa27e9..a7749043 100644
--- a/test/extract.cpp
+++ b/test/extract.cpp
@@ -7,7 +7,7 @@
#include "test_class.hpp"
#include
#include
-#include
+#include
#include
#include
#include
@@ -96,7 +96,7 @@ std::string x_rep(X const& x)
return "X(" + boost::lexical_cast(x.value()) + ")";
}
-BOOST_PYTHON_MODULE_INIT(extract_ext)
+BOOST_PYTHON_MODULE(extract_ext)
{
implicitly_convertible();
diff --git a/test/implicit.cpp b/test/implicit.cpp
index 2637f5ca..b56e6b10 100644
--- a/test/implicit.cpp
+++ b/test/implicit.cpp
@@ -5,7 +5,7 @@
// to its suitability for any purpose.
#include
#include
-#include
+#include
#include
#include "test_class.hpp"
@@ -20,7 +20,7 @@ int x_value(X const& x)
X make_x(int n) { return X(n); }
-BOOST_PYTHON_MODULE_INIT(implicit_ext)
+BOOST_PYTHON_MODULE(implicit_ext)
{
implicitly_convertible();
diff --git a/test/input_iterator.cpp b/test/input_iterator.cpp
index 19b50f77..eacae455 100644
--- a/test/input_iterator.cpp
+++ b/test/input_iterator.cpp
@@ -3,7 +3,7 @@
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
-#include
+#include
#include
#include
#include
@@ -35,7 +35,7 @@ list_range2 range2(list_int& x)
// to work around an MSVC6 linker bug, which causes it to complain
// about a "duplicate comdat" if the input iterator is instantiated in
// the same module with the others.
-BOOST_PYTHON_MODULE_INIT(input_iterator)
+BOOST_PYTHON_MODULE(input_iterator)
{
def("range2", &::range2);
diff --git a/test/iterator.cpp b/test/iterator.cpp
index 02e67546..93d4c009 100644
--- a/test/iterator.cpp
+++ b/test/iterator.cpp
@@ -3,7 +3,7 @@
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
-#include
+#include
#include
#include
#include
@@ -77,7 +77,7 @@ private:
list_int two;
};
-BOOST_PYTHON_MODULE_INIT(iterator_ext)
+BOOST_PYTHON_MODULE(iterator_ext)
{
def("range", &::range);
diff --git a/test/list.cpp b/test/list.cpp
index 83ea063b..15871e6a 100644
--- a/test/list.cpp
+++ b/test/list.cpp
@@ -4,7 +4,7 @@
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
-#include
+#include
#include
#include
#include
@@ -125,7 +125,7 @@ void exercise(list x, object y, object print)
assert(w[3] == 'i');
}
-BOOST_PYTHON_MODULE_INIT(list_ext)
+BOOST_PYTHON_MODULE(list_ext)
{
def("new_list", new_list);
def("listify", listify);
diff --git a/test/long.cpp b/test/long.cpp
index 32d3164a..cc619987 100644
--- a/test/long.cpp
+++ b/test/long.cpp
@@ -4,7 +4,7 @@
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
-#include
+#include
#include
#include
#include
@@ -39,7 +39,7 @@ int is_long2(char const*)
return 0;
}
-BOOST_PYTHON_MODULE_INIT(long_ext)
+BOOST_PYTHON_MODULE(long_ext)
{
def("new_long", new_long);
def("longify", longify);
diff --git a/test/m1.cpp b/test/m1.cpp
index 122ad04d..60498d2a 100644
--- a/test/m1.cpp
+++ b/test/m1.cpp
@@ -8,7 +8,7 @@
#include "simple_type.hpp"
#include "complicated.hpp"
#include
-#include
+#include
#include
#include
#include
@@ -199,7 +199,7 @@ D take_d_shared_ptr(boost::shared_ptr d) { return *d; }
boost::shared_ptr d_factory() { return boost::shared_ptr(new D); }
-BOOST_PYTHON_MODULE_INIT(m1)
+BOOST_PYTHON_MODULE(m1)
{
using namespace boost::python;
using boost::shared_ptr;
diff --git a/test/m2.cpp b/test/m2.cpp
index 5eee1a89..3108b2de 100644
--- a/test/m2.cpp
+++ b/test/m2.cpp
@@ -7,7 +7,7 @@
// This module exercises the converters exposed in m1 at a low level
// by exposing raw Python extension functions that use wrap<> and
// unwrap<> objects.
-#include
+#include
#include
#include
#include
@@ -61,7 +61,7 @@ struct rewrap
static T f(T x) { return x; }
};
-BOOST_PYTHON_MODULE_INIT(m2)
+BOOST_PYTHON_MODULE(m2)
{
using boost::python::return_value_policy;
using boost::python::copy_const_reference;
diff --git a/test/minimal.cpp b/test/minimal.cpp
index be0fe6ec..ac6fb4ae 100644
--- a/test/minimal.cpp
+++ b/test/minimal.cpp
@@ -3,14 +3,14 @@
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
-#include
+#include
#include
#if defined(_AIX) && defined(__EDG_VERSION__) && __EDG_VERSION__ < 245
# include // works around a KCC intermediate code generation bug
#endif
-BOOST_PYTHON_MODULE_INIT(minimal_ext)
+BOOST_PYTHON_MODULE(minimal_ext)
{
}
diff --git a/test/multi_arg_constructor.cpp b/test/multi_arg_constructor.cpp
index 24bc4d9a..d80f57ab 100644
--- a/test/multi_arg_constructor.cpp
+++ b/test/multi_arg_constructor.cpp
@@ -1,4 +1,4 @@
-#include
+#include
#include
#include
@@ -10,7 +10,7 @@ struct A
) {}
};
-BOOST_PYTHON_MODULE_INIT(multi_arg_constructor_ext)
+BOOST_PYTHON_MODULE(multi_arg_constructor_ext)
{
using namespace boost::python;
using boost::shared_ptr;
diff --git a/test/nested.cpp b/test/nested.cpp
index 8cbe3d79..12fd7bb1 100644
--- a/test/nested.cpp
+++ b/test/nested.cpp
@@ -3,7 +3,7 @@
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
-#include
+#include
#include
#include
#include
@@ -28,7 +28,7 @@ std::ostream& operator<<(std::ostream& s, Y const& x)
}
-BOOST_PYTHON_MODULE_INIT(nested_ext)
+BOOST_PYTHON_MODULE(nested_ext)
{
using namespace boost::python;
diff --git a/test/numpy.cpp b/test/numpy.cpp
index 36b9e070..8a02f6ee 100644
--- a/test/numpy.cpp
+++ b/test/numpy.cpp
@@ -6,7 +6,7 @@
#include
#include
-#include
+#include
#include
using namespace boost::python;
@@ -92,7 +92,7 @@ void exercise_numarray(numeric::array& y, object check)
check(y.factory(make_tuple(1.2, 3.4), "Double", make_tuple(2), true, true));
}
-BOOST_PYTHON_MODULE_INIT(numpy_ext)
+BOOST_PYTHON_MODULE(numpy_ext)
{
def("new_array", new_array);
def("take_array", take_array);
diff --git a/test/object.cpp b/test/object.cpp
index 6a76aeb3..bf702099 100755
--- a/test/object.cpp
+++ b/test/object.cpp
@@ -3,7 +3,7 @@
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
-#include
+#include
#include
#include
@@ -279,7 +279,7 @@ bool check_inplace(object l, object o)
return true;
}
-BOOST_PYTHON_MODULE_INIT(object_ext)
+BOOST_PYTHON_MODULE(object_ext)
{
def("call_object_3", call_object_3);
def("message", message);
diff --git a/test/operators.cpp b/test/operators.cpp
index dc2313df..e4ac1e07 100755
--- a/test/operators.cpp
+++ b/test/operators.cpp
@@ -6,7 +6,7 @@
#include
#include
#include
-#include
+#include
#include
#include "test_class.hpp"
#if __GNUC__ != 2
@@ -57,7 +57,7 @@ std::ostream& operator<<(std::ostream& s, X const& x)
return s << x.value();
}
-BOOST_PYTHON_MODULE_INIT(operators_ext)
+BOOST_PYTHON_MODULE(operators_ext)
{
class_("X", init())
.def("value", &X::value)
diff --git a/test/pickle1.cpp b/test/pickle1.cpp
index 1f9e5139..794799f8 100644
--- a/test/pickle1.cpp
+++ b/test/pickle1.cpp
@@ -10,7 +10,7 @@
For more information refer to boost/libs/python/doc/pickle.html.
*/
-#include
+#include
#include
#include
#include
@@ -45,7 +45,7 @@ namespace {
}
-BOOST_PYTHON_MODULE_INIT(pickle1_ext)
+BOOST_PYTHON_MODULE(pickle1_ext)
{
using namespace boost::python;
class_("world", init())
diff --git a/test/pickle2.cpp b/test/pickle2.cpp
index b8aacbd7..99401973 100644
--- a/test/pickle2.cpp
+++ b/test/pickle2.cpp
@@ -22,7 +22,7 @@
#include
-#include
+#include
#include
#include
#include
@@ -87,7 +87,7 @@ namespace { // Avoid cluttering the global namespace.
}
-BOOST_PYTHON_MODULE_INIT(pickle2_ext)
+BOOST_PYTHON_MODULE(pickle2_ext)
{
boost::python::class_(
"world", boost::python::init())
diff --git a/test/pickle3.cpp b/test/pickle3.cpp
index 5fae9e6c..8f243d39 100644
--- a/test/pickle3.cpp
+++ b/test/pickle3.cpp
@@ -17,7 +17,7 @@
#include
-#include