# HG changeset patch
# User ndbecker2@gmail.com
# Date 1263561792 18000
# Node ID 95ec21298abd99d21cb09ae12ce690acf423823d
# Parent be235100b4cc162113b704ce265d42bb4b70d159
Fix boost/python/module_init.hpp to use expand macros
diff -r be235100b4cc -r 95ec21298abd boost/python/module_init.hpp
a
|
b
|
|
6 | 6 | # define MODULE_INIT_DWA20020722_HPP |
7 | 7 | |
8 | 8 | # include <boost/python/detail/prefix.hpp> |
| 9 | # include <boost/preprocessor/cat.hpp> |
| 10 | # include <boost/preprocessor/stringize.hpp> |
9 | 11 | |
10 | 12 | # ifndef BOOST_PYTHON_MODULE_INIT |
11 | 13 | |
… |
… |
|
18 | 20 | # if PY_VERSION_HEX >= 0x03000000 |
19 | 21 | |
20 | 22 | # define _BOOST_PYTHON_MODULE_INIT(name) \ |
21 | | PyObject* PyInit_##name() \ |
| 23 | PyObject* BOOST_PP_CAT (PyInit_,name)() \ |
22 | 24 | { \ |
23 | 25 | return boost::python::detail::init_module( \ |
24 | | #name,&init_module_##name); \ |
| 26 | BOOST_PP_STRINGIZE(name),&BOOST_PP_CAT(init_module_,name)); \ |
25 | 27 | } \ |
26 | | void init_module_##name() |
| 28 | void BOOST_PP_CAT(init_module_,name)() |
27 | 29 | |
28 | 30 | # else |
29 | 31 | |
30 | 32 | # define _BOOST_PYTHON_MODULE_INIT(name) \ |
31 | | void init##name() \ |
| 33 | void BOOST_PP_CAT(init,name)() \ |
32 | 34 | { \ |
33 | 35 | boost::python::detail::init_module( \ |
34 | | #name,&init_module_##name); \ |
| 36 | BOOST_PP_STRINGIZE(name),&BOOST_PP_CAT(init_module_,name)); \ |
35 | 37 | } \ |
36 | | void init_module_##name() |
| 38 | void BOOST_PP_CAT(init_module_,name)() |
37 | 39 | |
38 | 40 | # endif |
39 | 41 | |
40 | 42 | # if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(BOOST_PYTHON_STATIC_MODULE) |
41 | 43 | |
42 | 44 | # define BOOST_PYTHON_MODULE_INIT(name) \ |
43 | | void init_module_##name(); \ |
| 45 | void BOOST_PP_CAT(init_module_,name)(); \ |
44 | 46 | extern "C" __declspec(dllexport) _BOOST_PYTHON_MODULE_INIT(name) |
45 | 47 | |
46 | 48 | # elif BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY |
47 | 49 | |
48 | 50 | # define BOOST_PYTHON_MODULE_INIT(name) \ |
49 | | void init_module_##name(); \ |
| 51 | void BOOST_PP_CAT(init_module_,name)(); \ |
50 | 52 | extern "C" __attribute__ ((visibility("default"))) _BOOST_PYTHON_MODULE_INIT(name) |
51 | 53 | |
52 | 54 | # else |
53 | 55 | |
54 | 56 | # define BOOST_PYTHON_MODULE_INIT(name) \ |
55 | | void init_module_##name(); \ |
| 57 | void BOOST_PP_CAT(init_module_,name)(); \ |
56 | 58 | extern "C" _BOOST_PYTHON_MODULE_INIT(name) |
57 | 59 | |
58 | 60 | # endif |