|
3 | 3 | // copyright notice appears in all copies. This software is provided |
4 | 4 | // "as is" without express or implied warranty, and with no claim as |
5 | 5 | // to its suitability for any purpose. |
6 | | -#ifndef MODULE_INIT_DWA2002529_HPP |
7 | | -# define MODULE_INIT_DWA2002529_HPP |
| 6 | +#ifndef MODULE_INIT_DWA20020722_HPP |
| 7 | +# define MODULE_INIT_DWA20020722_HPP |
| 8 | + |
| 9 | +# include <boost/python/detail/wrap_python.hpp> |
| 10 | +# include <boost/python/detail/config.hpp> |
8 | 11 |
|
9 | 12 | # ifndef BOOST_PYTHON_MODULE_INIT |
10 | 13 |
|
| 14 | +namespace boost { namespace python { namespace detail { |
| 15 | + |
| 16 | +BOOST_PYTHON_DECL void init_module(char const* name, void(*)()); |
| 17 | + |
| 18 | +}}} |
| 19 | + |
11 | 20 | # if defined(_WIN32) || defined(__CYGWIN__) |
12 | 21 |
|
13 | | -# define BOOST_PYTHON_MODULE_INIT(name) \ |
14 | | -void init_module_##name(); \ |
15 | | -extern "C" __declspec(dllexport) void init##name() \ |
16 | | -{ \ |
17 | | - boost::python::handle_exception(&init_module_##name); \ |
18 | | -} \ |
| 22 | +# define BOOST_PYTHON_MODULE_INIT(name) \ |
| 23 | +void init_module_##name(); \ |
| 24 | +extern "C" __declspec(dllexport) void init##name() \ |
| 25 | +{ \ |
| 26 | + boost::python::detail::init_module( \ |
| 27 | + #name,&init_module_##name); \ |
| 28 | +} \ |
19 | 29 | void init_module_##name() |
20 | 30 |
|
21 | 31 | # elif defined(_AIX) |
22 | 32 |
|
23 | 33 | # include <boost/python/detail/aix_init_module.hpp> |
24 | | -# define BOOST_PYTHON_MODULE_INIT(name) \ |
25 | | -void init_module_##name(); \ |
26 | | -extern "C" \ |
27 | | -{ \ |
28 | | - extern PyObject* _PyImport_LoadDynamicModule(char*, char*, FILE *); \ |
29 | | - void init##name() \ |
30 | | - { \ |
31 | | - boost::python::detail::aix_init_module(_PyImport_LoadDynamicModule, &init_module_##name); \ |
32 | | - } \ |
33 | | -} \ |
| 34 | +# define BOOST_PYTHON_MODULE_INIT(name) \ |
| 35 | +void init_module_##name(); \ |
| 36 | +extern "C" \ |
| 37 | +{ \ |
| 38 | + extern PyObject* _PyImport_LoadDynamicModule(char*, char*, FILE *); \ |
| 39 | + void init##name() \ |
| 40 | + { \ |
| 41 | + boost::python::detail::aix_init_module( \ |
| 42 | + _PyImport_LoadDynamicModule, #name, &init_module_##name); \ |
| 43 | + } \ |
| 44 | +} \ |
34 | 45 | void init_module_##name() |
35 | 46 |
|
36 | 47 | # else |
37 | 48 |
|
38 | | -# define BOOST_PYTHON_MODULE_INIT(name) \ |
39 | | -void init_module_##name(); \ |
40 | | -extern "C" void init##name() \ |
41 | | -{ \ |
42 | | - boost::python::handle_exception(&init_module_##name); \ |
43 | | -} \ |
| 49 | +# define BOOST_PYTHON_MODULE_INIT(name) \ |
| 50 | +void init_module_##name(); \ |
| 51 | +extern "C" void init##name() \ |
| 52 | +{ \ |
| 53 | + boost::python::detail::init_module(#name, &init_module_##name); \ |
| 54 | +} \ |
44 | 55 | void init_module_##name() |
45 | 56 |
|
46 | 57 | # endif |
47 | 58 |
|
48 | 59 | # endif |
49 | 60 |
|
50 | | -#endif // MODULE_INIT_DWA2002529_HPP |
| 61 | +#endif // MODULE_INIT_DWA20020722_HPP |
0 commit comments