mirror of
https://github.com/boostorg/python.git
synced 2026-01-24 06:02:14 +00:00
Finally, it works on AIX!
[SVN r14061]
This commit is contained in:
24
include/boost/python/detail/aix_init_module.hpp
Normal file
24
include/boost/python/detail/aix_init_module.hpp
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright David Abrahams 2002. Permission to copy, use,
|
||||
// modify, sell and distribute this software is granted provided this
|
||||
// copyright notice appears in all copies. This software is provided
|
||||
// "as is" without express or implied warranty, and with no claim as
|
||||
// to its suitability for any purpose.
|
||||
#ifndef AIX_INIT_MODULE_DWA2002529_HPP
|
||||
# define AIX_INIT_MODULE_DWA2002529_HPP
|
||||
# ifdef _AIX
|
||||
# include <boost/python/detail/wrap_python.hpp>
|
||||
# include <cstdio>
|
||||
|
||||
namespace boost { namespace python { namespace detail {
|
||||
|
||||
extern "C"
|
||||
{
|
||||
typedef PyObject* (*so_load_function)(char*,char*,FILE*);
|
||||
}
|
||||
|
||||
void aix_init_module(so_load_function, void (*init_module)());
|
||||
|
||||
}}} // namespace boost::python::detail
|
||||
# endif
|
||||
|
||||
#endif // AIX_INIT_MODULE_DWA2002529_HPP
|
||||
@@ -62,14 +62,6 @@
|
||||
# define BOOST_CSTD_ std
|
||||
# endif
|
||||
|
||||
# ifndef BOOST_PYTHON_MODULE_INIT
|
||||
# if defined(_WIN32) || defined(__CYGWIN__)
|
||||
# define BOOST_PYTHON_MODULE_INIT(name) void init_module_##name(); extern "C" __declspec(dllexport) void init##name() { boost::python::handle_exception(&init_module_##name); } void init_module_##name()
|
||||
# else
|
||||
# define BOOST_PYTHON_MODULE_INIT(name) void init_module_##name(); extern "C" void init##name() { boost::python::handle_exception(&init_module_##name); } void init_module_##name()
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Set up dll import/export options:
|
||||
|
||||
50
include/boost/python/detail/module_init.hpp
Normal file
50
include/boost/python/detail/module_init.hpp
Normal file
@@ -0,0 +1,50 @@
|
||||
// Copyright David Abrahams 2002. Permission to copy, use,
|
||||
// modify, sell and distribute this software is granted provided this
|
||||
// copyright notice appears in all copies. This software is provided
|
||||
// "as is" without express or implied warranty, and with no claim as
|
||||
// to its suitability for any purpose.
|
||||
#ifndef MODULE_INIT_DWA2002529_HPP
|
||||
# define MODULE_INIT_DWA2002529_HPP
|
||||
|
||||
# ifndef BOOST_PYTHON_MODULE_INIT
|
||||
|
||||
# if defined(_WIN32) || defined(__CYGWIN__)
|
||||
|
||||
# define BOOST_PYTHON_MODULE_INIT(name) \
|
||||
void init_module_##name(); \
|
||||
extern "C" __declspec(dllexport) void init##name() \
|
||||
{ \
|
||||
boost::python::handle_exception(&init_module_##name); \
|
||||
} \
|
||||
void init_module_##name()
|
||||
|
||||
# elif defined(_AIX)
|
||||
|
||||
# include <boost/python/detail/aix_init_module.hpp>
|
||||
# define BOOST_PYTHON_MODULE_INIT(name) \
|
||||
void init_module_##name(); \
|
||||
extern "C" \
|
||||
{ \
|
||||
extern PyObject* _PyImport_LoadDynamicModule(char*, char*, FILE *); \
|
||||
void init##name() \
|
||||
{ \
|
||||
boost::python::detail::aix_init_module(_PyImport_LoadDynamicModule, &init_module_##name); \
|
||||
} \
|
||||
} \
|
||||
void init_module_##name()
|
||||
|
||||
# else
|
||||
|
||||
# define BOOST_PYTHON_MODULE_INIT(name) \
|
||||
void init_module_##name(); \
|
||||
extern "C" void init##name() \
|
||||
{ \
|
||||
boost::python::handle_exception(&init_module_##name); \
|
||||
} \
|
||||
void init_module_##name()
|
||||
|
||||
# endif
|
||||
|
||||
# endif
|
||||
|
||||
#endif // MODULE_INIT_DWA2002529_HPP
|
||||
@@ -12,6 +12,7 @@
|
||||
# include <boost/python/objects.hpp>
|
||||
# include <boost/python/class_fwd.hpp>
|
||||
# include <boost/python/detail/module_base.hpp>
|
||||
# include <boost/python/detail/module_init.hpp>
|
||||
|
||||
namespace boost { namespace python {
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# include <boost/python/reference.hpp>
|
||||
# include <boost/python/objects.hpp>
|
||||
# include <boost/python/detail/functions.hpp>
|
||||
# include <boost/python/detail/module_init.hpp>
|
||||
|
||||
namespace boost { namespace python {
|
||||
|
||||
|
||||
@@ -10,13 +10,16 @@
|
||||
# include <boost/python/detail/msvc_typeinfo.hpp>
|
||||
# include <boost/operators.hpp>
|
||||
# include <typeinfo>
|
||||
# include <cstring>
|
||||
# include <boost/static_assert.hpp>
|
||||
# include <boost/type_traits/same_traits.hpp>
|
||||
|
||||
namespace boost { namespace python {
|
||||
|
||||
// for this compiler at least, cross-shared-library type_info
|
||||
// comparisons don't work, so use typeid(x).name() instead. It's not
|
||||
// yet clear what the best default strategy is.
|
||||
# if defined(__GNUC__) && __GNUC__ >= 3
|
||||
# if defined(__GNUC__) && __GNUC__ >= 3 || defined(_AIX)
|
||||
# define BOOST_PYTHON_TYPE_ID_NAME
|
||||
# endif
|
||||
|
||||
@@ -56,6 +59,27 @@ inline type_info type_id(boost::type<T>* = 0)
|
||||
);
|
||||
}
|
||||
|
||||
# if defined(_AIX) && defined(__EDG_VERSION__) && __EDG_VERSION__ <= 245
|
||||
// KCC on this platform seems to mistakenly distinguish "int" from
|
||||
// "signed int", etc., but only in typeid() expressions. However
|
||||
// though int == signed int, the "signed" decoration is propagated
|
||||
// down into template instantiations. Explicit specialization stops
|
||||
// that from taking hold.
|
||||
|
||||
# define BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID(T) \
|
||||
template <> \
|
||||
inline type_info type_id<T>(boost::type<T>*) \
|
||||
{ \
|
||||
return type_info(typeid(T)); \
|
||||
}
|
||||
|
||||
BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID(short)
|
||||
BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID(int)
|
||||
BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID(long)
|
||||
# undef BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID
|
||||
# endif
|
||||
|
||||
|
||||
inline type_info::type_info(std::type_info const& id)
|
||||
: m_base_type(
|
||||
# ifdef BOOST_PYTHON_TYPE_ID_NAME
|
||||
|
||||
Reference in New Issue
Block a user