Warning, file /include/boost/python/module_init.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005 #ifndef MODULE_INIT_DWA20020722_HPP
0006 # define MODULE_INIT_DWA20020722_HPP
0007
0008 # include <boost/python/detail/prefix.hpp>
0009 # include <boost/preprocessor/cat.hpp>
0010 # include <boost/preprocessor/stringize.hpp>
0011
0012 # ifndef BOOST_PYTHON_MODULE_INIT
0013
0014 namespace boost { namespace python { namespace detail {
0015
0016 # if PY_VERSION_HEX >= 0x03000000
0017
0018 BOOST_PYTHON_DECL PyObject* init_module(PyModuleDef&, void(*)());
0019
0020 #else
0021
0022 BOOST_PYTHON_DECL PyObject* init_module(char const* name, void(*)());
0023
0024 #endif
0025
0026 }}}
0027
0028 # if PY_VERSION_HEX >= 0x03000000
0029
0030 # define _BOOST_PYTHON_MODULE_INIT(name) \
0031 PyObject* BOOST_PP_CAT(PyInit_, name)() \
0032 { \
0033 static PyModuleDef_Base initial_m_base = { \
0034 PyObject_HEAD_INIT(NULL) \
0035 0, \
0036 0, \
0037 0 }; \
0038 static PyMethodDef initial_methods[] = { { 0, 0, 0, 0 } }; \
0039 \
0040 static struct PyModuleDef moduledef = { \
0041 initial_m_base, \
0042 BOOST_PP_STRINGIZE(name), \
0043 0, \
0044 -1, \
0045 initial_methods, \
0046 0, \
0047 0, \
0048 0, \
0049 0, \
0050 }; \
0051 \
0052 return boost::python::detail::init_module( \
0053 moduledef, BOOST_PP_CAT(init_module_, name) ); \
0054 } \
0055 void BOOST_PP_CAT(init_module_, name)()
0056
0057 # else
0058
0059 # define _BOOST_PYTHON_MODULE_INIT(name) \
0060 void BOOST_PP_CAT(init,name)() \
0061 { \
0062 boost::python::detail::init_module( \
0063 BOOST_PP_STRINGIZE(name),&BOOST_PP_CAT(init_module_,name)); \
0064 } \
0065 void BOOST_PP_CAT(init_module_,name)()
0066
0067 # endif
0068
0069 # define BOOST_PYTHON_MODULE_INIT(name) \
0070 void BOOST_PP_CAT(init_module_,name)(); \
0071 extern "C" BOOST_SYMBOL_EXPORT _BOOST_PYTHON_MODULE_INIT(name)
0072
0073 # endif
0074
0075 #endif