# 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/boost/python/module_init.hpp Wed Nov 25 07:57:31 2009 -0500 +++ b/boost/python/module_init.hpp Fri Jan 15 08:23:12 2010 -0500 @@ -6,6 +6,8 @@ # define MODULE_INIT_DWA20020722_HPP # include +# include +# include # ifndef BOOST_PYTHON_MODULE_INIT @@ -18,41 +20,41 @@ # if PY_VERSION_HEX >= 0x03000000 # define _BOOST_PYTHON_MODULE_INIT(name) \ -PyObject* PyInit_##name() \ + PyObject* BOOST_PP_CAT (PyInit_,name)() \ { \ return boost::python::detail::init_module( \ - #name,&init_module_##name); \ + BOOST_PP_STRINGIZE(name),&BOOST_PP_CAT(init_module_,name)); \ } \ -void init_module_##name() + void BOOST_PP_CAT(init_module_,name)() # else # define _BOOST_PYTHON_MODULE_INIT(name) \ -void init##name() \ + void BOOST_PP_CAT(init,name)() \ { \ boost::python::detail::init_module( \ - #name,&init_module_##name); \ + BOOST_PP_STRINGIZE(name),&BOOST_PP_CAT(init_module_,name)); \ } \ -void init_module_##name() + void BOOST_PP_CAT(init_module_,name)() # endif # if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(BOOST_PYTHON_STATIC_MODULE) # define BOOST_PYTHON_MODULE_INIT(name) \ -void init_module_##name(); \ + void BOOST_PP_CAT(init_module_,name)(); \ extern "C" __declspec(dllexport) _BOOST_PYTHON_MODULE_INIT(name) # elif BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY # define BOOST_PYTHON_MODULE_INIT(name) \ -void init_module_##name(); \ + void BOOST_PP_CAT(init_module_,name)(); \ extern "C" __attribute__ ((visibility("default"))) _BOOST_PYTHON_MODULE_INIT(name) # else # define BOOST_PYTHON_MODULE_INIT(name) \ -void init_module_##name(); \ + void BOOST_PP_CAT(init_module_,name)(); \ extern "C" _BOOST_PYTHON_MODULE_INIT(name) # endif