mirror of
https://github.com/boostorg/python.git
synced 2026-01-19 04:22:16 +00:00
Fix c++11 detection.
This commit is contained in:
committed by
Stefan Seefeld
parent
7c5e478432
commit
30c9eb1fb6
@@ -15,7 +15,7 @@ def add_options(vars):
|
||||
|
||||
def check(context):
|
||||
|
||||
source = r"""#if __cplusplus < 201103L
|
||||
source = r"""#if __cplusplus < 201103L && (!defined(_MSC_VER) || _MSC_VER < 1800)
|
||||
#error no C++11
|
||||
#endif"""
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace detail
|
||||
registry::lookup_shared_ptr(type_id<shared_ptr<T> >());
|
||||
}
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
#if !defined(BOOST_NO_CXX11_SMART_PTR)
|
||||
template <class T>
|
||||
inline void
|
||||
register_shared_ptr0(std::shared_ptr<T>*)
|
||||
|
||||
@@ -25,7 +25,7 @@ PyObject* shared_ptr_to_python(shared_ptr<T> const& x)
|
||||
return converter::registered<shared_ptr<T> const&>::converters.to_python(&x);
|
||||
}
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
#if !defined(BOOST_NO_CXX11_SMART_PTR)
|
||||
template <class T>
|
||||
PyObject* shared_ptr_to_python(std::shared_ptr<T> const& x)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
namespace boost { namespace python { namespace detail {
|
||||
|
||||
BOOST_PYTHON_IS_XXX_DEF(shared_ptr, shared_ptr, 1)
|
||||
#if __cplusplus >= 201103L
|
||||
#if !defined(BOOST_NO_CXX11_SMART_PTR)
|
||||
template <typename T>
|
||||
struct is_shared_ptr<std::shared_ptr<T> > : std::true_type {};
|
||||
#endif
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
# define BOOST_PYTHON_DETAIL_TYPE_TRAITS_HPP
|
||||
|
||||
|
||||
#if __cplusplus < 201103L
|
||||
#if __cplusplus < 201103L && (!defined(BOOST_MSVC) || BOOST_MSVC<=1600)
|
||||
#define BOOST_PYTHON_USE_BOOST_TYPES
|
||||
# include <boost/type_traits/transform_traits.hpp>
|
||||
# include <boost/type_traits/same_traits.hpp>
|
||||
# include <boost/type_traits/cv_traits.hpp>
|
||||
@@ -34,7 +35,7 @@
|
||||
|
||||
namespace boost { namespace python { namespace detail {
|
||||
|
||||
#if __cplusplus < 201103L
|
||||
#if defined(BOOST_PYTHON_USE_BOOST_TYPES)
|
||||
using boost::alignment_of;
|
||||
using boost::add_const;
|
||||
using boost::add_cv;
|
||||
|
||||
@@ -83,7 +83,7 @@ inline void register_shared_ptr_from_python_and_casts(T*, Bases)
|
||||
{
|
||||
// Constructor performs registration
|
||||
python::detail::force_instantiate(converter::shared_ptr_from_python<T, boost::shared_ptr>());
|
||||
#if __cplusplus >= 201103L
|
||||
#if !defined(BOOST_NO_CXX11_SMART_PTR)
|
||||
python::detail::force_instantiate(converter::shared_ptr_from_python<T, std::shared_ptr>());
|
||||
#endif
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace detail
|
||||
// copy constructor.
|
||||
# if defined(__ICL) && __ICL < 600
|
||||
typedef boost::shared_ptr<T> smart_pointer;
|
||||
# elif __cplusplus < 201103L
|
||||
# elif defined(BOOST_NO_CXX11_SMART_PTR)
|
||||
typedef std::auto_ptr<T> smart_pointer;
|
||||
# else
|
||||
typedef std::unique_ptr<T> smart_pointer;
|
||||
|
||||
@@ -118,7 +118,7 @@ struct object_manager_get_pytype<true>
|
||||
PyTypeObject const* get_pytype(boost::type<shared_ptr<U> &> *) const {return converter::registered<U>::converters.to_python_target_type();}
|
||||
template <class U>
|
||||
PyTypeObject const* get_pytype(boost::type<const shared_ptr<U> &> *) const {return converter::registered<U>::converters.to_python_target_type();}
|
||||
# if __cplusplus >= 201103L
|
||||
# if !defined(BOOST_NO_CXX11_SMART_PTR)
|
||||
template <class U>
|
||||
PyTypeObject const* get_pytype(boost::type<std::shared_ptr<U> &> *) const {return converter::registered<U>::converters.to_python_target_type();}
|
||||
template <class U>
|
||||
|
||||
Reference in New Issue
Block a user