Update contrib.
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
8 # include <boost/python/detail/prefix.hpp>
10 # ifndef BOOST_PYTHON_MODULE_INIT
12 namespace boost { namespace python { namespace detail {
14 BOOST_PYTHON_DECL void init_module(char const* name, void(*)());
18 # if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(BOOST_PYTHON_STATIC_MODULE)
20 # define BOOST_PYTHON_MODULE_INIT(name) \
21 void init_module_##name(); \
22 extern "C" __declspec(dllexport) void init##name() \
24 boost::python::detail::init_module( \
25 #name,&init_module_##name); \
27 void init_module_##name()
29 # elif defined(_AIX) && !defined(BOOST_PYTHON_STATIC_MODULE)
31 # include <boost/python/detail/aix_init_module.hpp>
32 # define BOOST_PYTHON_MODULE_INIT(name) \
33 void init_module_##name(); \
36 extern PyObject* _PyImport_LoadDynamicModule(char*, char*, FILE *); \
39 boost::python::detail::aix_init_module( \
40 _PyImport_LoadDynamicModule, #name, &init_module_##name); \
43 void init_module_##name()
45 # elif BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY
47 # define BOOST_PYTHON_MODULE_INIT(name) \
48 void init_module_##name(); \
49 extern "C" __attribute__ ((visibility("default"))) void init##name() \
51 boost::python::detail::init_module(#name, &init_module_##name); \
53 void init_module_##name()
57 # define BOOST_PYTHON_MODULE_INIT(name) \
58 void init_module_##name(); \
59 extern "C" void init##name() \
61 boost::python::detail::init_module(#name, &init_module_##name); \
63 void init_module_##name()
69 #endif // MODULE_INIT_DWA20020722_HPP