[29] | 1 | // Copyright David Abrahams 2002. |
---|
| 2 | // Distributed under the Boost Software License, Version 1.0. (See |
---|
| 3 | // accompanying file LICENSE_1_0.txt or copy at |
---|
| 4 | // http://www.boost.org/LICENSE_1_0.txt) |
---|
| 5 | #ifndef MODULE_INIT_DWA20020722_HPP |
---|
| 6 | # define MODULE_INIT_DWA20020722_HPP |
---|
| 7 | |
---|
| 8 | # include <boost/python/detail/prefix.hpp> |
---|
| 9 | |
---|
| 10 | # ifndef BOOST_PYTHON_MODULE_INIT |
---|
| 11 | |
---|
| 12 | namespace boost { namespace python { namespace detail { |
---|
| 13 | |
---|
| 14 | BOOST_PYTHON_DECL void init_module(char const* name, void(*)()); |
---|
| 15 | |
---|
| 16 | }}} |
---|
| 17 | |
---|
| 18 | # if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(BOOST_PYTHON_STATIC_MODULE) |
---|
| 19 | |
---|
| 20 | # define BOOST_PYTHON_MODULE_INIT(name) \ |
---|
| 21 | void init_module_##name(); \ |
---|
| 22 | extern "C" __declspec(dllexport) void init##name() \ |
---|
| 23 | { \ |
---|
| 24 | boost::python::detail::init_module( \ |
---|
| 25 | #name,&init_module_##name); \ |
---|
| 26 | } \ |
---|
| 27 | void init_module_##name() |
---|
| 28 | |
---|
| 29 | # elif BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY |
---|
| 30 | |
---|
| 31 | # define BOOST_PYTHON_MODULE_INIT(name) \ |
---|
| 32 | void init_module_##name(); \ |
---|
| 33 | extern "C" __attribute__ ((visibility("default"))) void init##name() \ |
---|
| 34 | { \ |
---|
| 35 | boost::python::detail::init_module(#name, &init_module_##name); \ |
---|
| 36 | } \ |
---|
| 37 | void init_module_##name() |
---|
| 38 | |
---|
| 39 | # else |
---|
| 40 | |
---|
| 41 | # define BOOST_PYTHON_MODULE_INIT(name) \ |
---|
| 42 | void init_module_##name(); \ |
---|
| 43 | extern "C" void init##name() \ |
---|
| 44 | { \ |
---|
| 45 | boost::python::detail::init_module(#name, &init_module_##name); \ |
---|
| 46 | } \ |
---|
| 47 | void init_module_##name() |
---|
| 48 | |
---|
| 49 | # endif |
---|
| 50 | |
---|
| 51 | # endif |
---|
| 52 | |
---|
| 53 | #endif // MODULE_INIT_DWA20020722_HPP |
---|