Ticket #3843: boost_python_modules_init.hpp.patch

File boost_python_modules_init.hpp.patch, 2.7 KB (added by ndbecker2@…, 13 years ago)

Patch

  • boost/python/module_init.hpp

    # 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  
    66# define MODULE_INIT_DWA20020722_HPP
    77
    88# include <boost/python/detail/prefix.hpp>
     9# include <boost/preprocessor/cat.hpp>
     10# include <boost/preprocessor/stringize.hpp>
    911
    1012# ifndef BOOST_PYTHON_MODULE_INIT
    1113
     
    1820#  if PY_VERSION_HEX >= 0x03000000
    1921
    2022#   define _BOOST_PYTHON_MODULE_INIT(name)              \
    21 PyObject* PyInit_##name()      \
     23  PyObject* BOOST_PP_CAT (PyInit_,name)()               \
    2224{                                                       \
    2325    return boost::python::detail::init_module(          \
    24             #name,&init_module_##name);                \
     26                                              BOOST_PP_STRINGIZE(name),&BOOST_PP_CAT(init_module_,name)); \
    2527}                                                       \
    26 void init_module_##name()
     28  void BOOST_PP_CAT(init_module_,name)()
    2729
    2830#  else
    2931
    3032#   define _BOOST_PYTHON_MODULE_INIT(name)              \
    31 void init##name()                                       \
     33  void BOOST_PP_CAT(init,name)()                        \
    3234{                                                       \
    3335    boost::python::detail::init_module(                 \
    34         #name,&init_module_##name);                    \
     36                                       BOOST_PP_STRINGIZE(name),&BOOST_PP_CAT(init_module_,name)); \
    3537}                                                       \
    36 void init_module_##name()
     38  void BOOST_PP_CAT(init_module_,name)()
    3739
    3840#  endif
    3941
    4042#  if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(BOOST_PYTHON_STATIC_MODULE)
    4143
    4244#   define BOOST_PYTHON_MODULE_INIT(name)                           \
    43 void init_module_##name();                                          \
     45  void BOOST_PP_CAT(init_module_,name)();                           \
    4446extern "C" __declspec(dllexport) _BOOST_PYTHON_MODULE_INIT(name)
    4547
    4648#  elif BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY
    4749
    4850#   define BOOST_PYTHON_MODULE_INIT(name)                               \
    49 void init_module_##name();                                              \
     51  void BOOST_PP_CAT(init_module_,name)();                               \
    5052extern "C" __attribute__ ((visibility("default"))) _BOOST_PYTHON_MODULE_INIT(name)
    5153
    5254#  else
    5355
    5456#   define BOOST_PYTHON_MODULE_INIT(name)                               \
    55 void init_module_##name();                                              \
     57  void BOOST_PP_CAT(init_module_,name)();                               \
    5658extern "C" _BOOST_PYTHON_MODULE_INIT(name)
    5759
    5860#  endif