Skip to content

Commit b1ccb5f

Browse files
committed
Fix c++11 detection.
1 parent a72848c commit b1ccb5f

File tree

8 files changed

+10
-9
lines changed

8 files changed

+10
-9
lines changed

config/cxx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def add_options(vars):
1515

1616
def check(context):
1717

18-
source = r"""#if __cplusplus < 201103L
18+
source = r"""#if __cplusplus < 201103L && (!defined(_MSC_VER) || _MSC_VER < 1800)
1919
#error no C++11
2020
#endif"""
2121

include/boost/python/converter/registered.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ namespace detail
7676
registry::lookup_shared_ptr(type_id<shared_ptr<T> >());
7777
}
7878

79-
#if __cplusplus >= 201103L
79+
#if !defined(BOOST_NO_CXX11_SMART_PTR)
8080
template <class T>
8181
inline void
8282
register_shared_ptr0(std::shared_ptr<T>*)

include/boost/python/converter/shared_ptr_to_python.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ PyObject* shared_ptr_to_python(shared_ptr<T> const& x)
2525
return converter::registered<shared_ptr<T> const&>::converters.to_python(&x);
2626
}
2727

28-
#if __cplusplus >= 201103L
28+
#if !defined(BOOST_NO_CXX11_SMART_PTR)
2929
template <class T>
3030
PyObject* shared_ptr_to_python(std::shared_ptr<T> const& x)
3131
{

include/boost/python/detail/is_shared_ptr.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
namespace boost { namespace python { namespace detail {
1414

1515
BOOST_PYTHON_IS_XXX_DEF(shared_ptr, shared_ptr, 1)
16-
#if __cplusplus >= 201103L
16+
#if !defined(BOOST_NO_CXX11_SMART_PTR)
1717
template <typename T>
1818
struct is_shared_ptr<std::shared_ptr<T> > : std::true_type {};
1919
#endif

include/boost/python/detail/type_traits.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
# define BOOST_PYTHON_DETAIL_TYPE_TRAITS_HPP
88

99

10-
#if __cplusplus < 201103L
10+
#if __cplusplus < 201103L && (!defined(BOOST_MSVC) || BOOST_MSVC<=1600)
11+
#define BOOST_PYTHON_USE_BOOST_TYPES
1112
# include <boost/type_traits/transform_traits.hpp>
1213
# include <boost/type_traits/same_traits.hpp>
1314
# include <boost/type_traits/cv_traits.hpp>
@@ -34,7 +35,7 @@
3435

3536
namespace boost { namespace python { namespace detail {
3637

37-
#if __cplusplus < 201103L
38+
#if defined(BOOST_PYTHON_USE_BOOST_TYPES)
3839
using boost::alignment_of;
3940
using boost::add_const;
4041
using boost::add_cv;

include/boost/python/object/class_metadata.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ inline void register_shared_ptr_from_python_and_casts(T*, Bases)
8383
{
8484
// Constructor performs registration
8585
python::detail::force_instantiate(converter::shared_ptr_from_python<T, boost::shared_ptr>());
86-
#if __cplusplus >= 201103L
86+
#if !defined(BOOST_NO_CXX11_SMART_PTR)
8787
python::detail::force_instantiate(converter::shared_ptr_from_python<T, std::shared_ptr>());
8888
#endif
8989

include/boost/python/to_python_indirect.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ namespace detail
8383
// copy constructor.
8484
# if defined(__ICL) && __ICL < 600
8585
typedef boost::shared_ptr<T> smart_pointer;
86-
# elif __cplusplus < 201103L
86+
# elif BOOST_NO_CXX11_SMART_PTR
8787
typedef std::auto_ptr<T> smart_pointer;
8888
# else
8989
typedef std::unique_ptr<T> smart_pointer;

include/boost/python/to_python_value.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ struct object_manager_get_pytype<true>
118118
PyTypeObject const* get_pytype(boost::type<shared_ptr<U> &> *) const {return converter::registered<U>::converters.to_python_target_type();}
119119
template <class U>
120120
PyTypeObject const* get_pytype(boost::type<const shared_ptr<U> &> *) const {return converter::registered<U>::converters.to_python_target_type();}
121-
# if __cplusplus >= 201103L
121+
# if !defined(BOOST_NO_CXX11_SMART_PTR)
122122
template <class U>
123123
PyTypeObject const* get_pytype(boost::type<std::shared_ptr<U> &> *) const {return converter::registered<U>::converters.to_python_target_type();}
124124
template <class U>

0 commit comments

Comments
 (0)