diff --git a/build/Attic/python_v1.zip b/build/Attic/python_v1.zip deleted file mode 100644 index 0377a07b..00000000 Binary files a/build/Attic/python_v1.zip and /dev/null differ diff --git a/example/boost-build.jam b/example/boost-build.jam index b7220e2c..9b8d19e0 100755 --- a/example/boost-build.jam +++ b/example/boost-build.jam @@ -2,6 +2,6 @@ # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -# Edit this path to point at the tools/build/v2 subdirectory of your +# Edit this path to point at the tools/build/src subdirectory of your # Boost installation. Absolute paths work, too. -boost-build ../../../tools/build/v2 ; +boost-build ../../../tools/build/src ; diff --git a/example/quickstart/Jamroot b/example/quickstart/Jamroot index 9b57a009..8425638c 100644 --- a/example/quickstart/Jamroot +++ b/example/quickstart/Jamroot @@ -31,7 +31,7 @@ import testing ; testing.make-test run-pyd : extending test_extending.py : : test_ext ; # Declare a test of the embedding application -testing.run embedding +testing.run embedding embedding.cpp : # any ordinary arguments : script.py # any arguments that should be treated as relative paths : # requirements diff --git a/example/quickstart/boost-build.jam b/example/quickstart/boost-build.jam index a440ea9f..cf910e79 100644 --- a/example/quickstart/boost-build.jam +++ b/example/quickstart/boost-build.jam @@ -2,6 +2,6 @@ # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -# Edit this path to point at the tools/build/v2 subdirectory of your +# Edit this path to point at the tools/build/src subdirectory of your # Boost installation. Absolute paths work, too. -boost-build ../../../../tools/build/v2 ; +boost-build ../../../../tools/build/src ; diff --git a/include/boost/python.hpp b/include/boost/python.hpp index ae49abaf..11067c17 100644 --- a/include/boost/python.hpp +++ b/include/boost/python.hpp @@ -53,6 +53,7 @@ # include # include # include +# include # include # include # include @@ -61,7 +62,9 @@ # include # include # include +# include # include +# include # include # include # include diff --git a/include/boost/python/args.hpp b/include/boost/python/args.hpp index 8f8791d7..55d1283b 100644 --- a/include/boost/python/args.hpp +++ b/include/boost/python/args.hpp @@ -102,7 +102,6 @@ namespace detail return this->operator,(python::arg(name)); } -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct is_keywords { @@ -126,31 +125,6 @@ namespace detail typedef mpl::bool_ type; BOOST_PYTHON_MPL_LAMBDA_SUPPORT(1,is_reference_to_keywords,(T)) }; -# else - typedef char (&yes_keywords_t)[1]; - typedef char (&no_keywords_t)[2]; - - no_keywords_t is_keywords_test(...); - - template - yes_keywords_t is_keywords_test(void (*)(keywords&)); - - template - yes_keywords_t is_keywords_test(void (*)(keywords const&)); - - template - class is_reference_to_keywords - { - public: - BOOST_STATIC_CONSTANT( - bool, value = ( - sizeof(detail::is_keywords_test( (void (*)(T))0 )) - == sizeof(detail::yes_keywords_t))); - - typedef mpl::bool_ type; - BOOST_PYTHON_MPL_LAMBDA_SUPPORT(1,is_reference_to_keywords,(T)) - }; -# endif } inline detail::keywords<1> args(char const* name) diff --git a/include/boost/python/back_reference.hpp b/include/boost/python/back_reference.hpp index c1daba60..e68066f7 100644 --- a/include/boost/python/back_reference.hpp +++ b/include/boost/python/back_reference.hpp @@ -29,7 +29,6 @@ struct back_reference T m_value; }; -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template class is_back_reference { @@ -44,36 +43,6 @@ class is_back_reference > BOOST_STATIC_CONSTANT(bool, value = true); }; -# else // no partial specialization - -}} // namespace boost::python - -#include - -namespace boost { namespace python { - -namespace detail -{ - typedef char (&yes_back_reference_t)[1]; - typedef char (&no_back_reference_t)[2]; - - no_back_reference_t is_back_reference_test(...); - - template - yes_back_reference_t is_back_reference_test(boost::type< back_reference >); -} - -template -class is_back_reference -{ - public: - BOOST_STATIC_CONSTANT( - bool, value = ( - sizeof(detail::is_back_reference_test(boost::type())) - == sizeof(detail::yes_back_reference_t))); -}; - -# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION // // implementations diff --git a/include/boost/python/bases.hpp b/include/boost/python/bases.hpp index 0bd7350e..614d6223 100644 --- a/include/boost/python/bases.hpp +++ b/include/boost/python/bases.hpp @@ -24,7 +24,6 @@ namespace boost { namespace python { namespace detail { -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct specifies_bases : mpl::false_ { @@ -35,23 +34,6 @@ namespace boost { namespace python { : mpl::true_ { }; -# else - template < BOOST_PP_ENUM_PARAMS(BOOST_PYTHON_MAX_BASES, class Base) > - static char is_bases_helper(bases< BOOST_PYTHON_BASE_PARAMS > const&); - - static char (& is_bases_helper(...) )[256]; - - template - struct specifies_bases - { - private: - static typename add_reference::type make(); - BOOST_STATIC_CONSTANT(bool, non_ref = !is_reference::value); - public: - BOOST_STATIC_CONSTANT(bool, value = non_ref & (sizeof(is_bases_helper(make())) == 1)); - typedef mpl::bool_ type; - }; -# endif template > struct select_bases : mpl::if_< diff --git a/include/boost/python/class.hpp b/include/boost/python/class.hpp index 253667bb..f43b615a 100644 --- a/include/boost/python/class.hpp +++ b/include/boost/python/class.hpp @@ -45,8 +45,7 @@ # if BOOST_WORKAROUND(__MWERKS__, <= 0x3004) \ /* pro9 reintroduced the bug */ \ || (BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ - && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) \ - || BOOST_WORKAROUND(__GNUC__, < 3) + && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) # define BOOST_PYTHON_NO_MEMBER_POINTER_ORDERING 1 @@ -302,7 +301,6 @@ class class_ : public objects::class_base } // Property creation -# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) template self& add_property(char const* name, Get fget, char const* docstr = 0) { @@ -317,47 +315,6 @@ class class_ : public objects::class_base name, this->make_getter(fget), this->make_setter(fset), docstr); return *this; } -# else - private: - template - self& add_property_impl(char const* name, Get fget, char const* docstr, int) - { - base::add_property(name, this->make_getter(fget), docstr); - return *this; - } - - template - self& add_property_impl(char const* name, Get fget, Set fset, ...) - { - base::add_property( - name, this->make_getter(fget), this->make_setter(fset), 0); - return *this; - } - - public: - template - self& add_property(char const* name, Get fget) - { - base::add_property(name, this->make_getter(fget), 0); - return *this; - } - - template - self& add_property(char const* name, Get fget, DocStrOrSet docstr_or_set) - { - this->add_property_impl(name, this->make_getter(fget), docstr_or_set, 0); - return *this; - } - - template - self& - add_property(char const* name, Get fget, Set fset, char const* docstr) - { - base::add_property( - name, this->make_getter(fget), this->make_setter(fset), docstr); - return *this; - } -# endif template self& add_static_property(char const* name, Get fget) diff --git a/include/boost/python/converter/arg_from_python.hpp b/include/boost/python/converter/arg_from_python.hpp old mode 100755 new mode 100644 index e2edce7e..61bbaad5 --- a/include/boost/python/converter/arg_from_python.hpp +++ b/include/boost/python/converter/arg_from_python.hpp @@ -115,9 +115,9 @@ struct arg_rvalue_from_python arg_rvalue_from_python(PyObject*); bool convertible() const; -# if BOOST_MSVC < 1301 || _MSC_FULL_VER > 13102196 +# if _MSC_FULL_VER > 13102196 typename arg_rvalue_from_python:: -# endif +# endif result_type operator()(); private: diff --git a/include/boost/python/converter/arg_to_python_base.hpp b/include/boost/python/converter/arg_to_python_base.hpp old mode 100755 new mode 100644 index d85b302e..c66ce9c3 --- a/include/boost/python/converter/arg_to_python_base.hpp +++ b/include/boost/python/converter/arg_to_python_base.hpp @@ -13,17 +13,9 @@ struct registration; namespace detail { struct BOOST_PYTHON_DECL arg_to_python_base -# if !defined(BOOST_MSVC) || BOOST_MSVC <= 1300 || _MSC_FULL_VER > 13102179 : handle<> -# endif { arg_to_python_base(void const volatile* source, registration const&); -# if defined(BOOST_MSVC) && BOOST_MSVC > 1300 && _MSC_FULL_VER <= 13102179 - PyObject* get() const { return m_ptr.get(); } - PyObject* release() { return m_ptr.release(); } - private: - handle<> m_ptr; -# endif }; } diff --git a/include/boost/python/converter/object_manager.hpp b/include/boost/python/converter/object_manager.hpp old mode 100755 new mode 100644 index 84e44d47..46682455 --- a/include/boost/python/converter/object_manager.hpp +++ b/include/boost/python/converter/object_manager.hpp @@ -121,7 +121,6 @@ struct is_object_manager { }; -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct is_reference_to_object_manager : mpl::false_ @@ -151,79 +150,6 @@ struct is_reference_to_object_manager : is_object_manager { }; -# else - -namespace detail -{ - typedef char (&yes_reference_to_object_manager)[1]; - typedef char (&no_reference_to_object_manager)[2]; - - // A number of nastinesses go on here in order to work around MSVC6 - // bugs. - template - struct is_object_manager_help - { - typedef typename mpl::if_< - is_object_manager - , yes_reference_to_object_manager - , no_reference_to_object_manager - >::type type; - - // If we just use the type instead of the result of calling this - // function, VC6 will ICE. - static type call(); - }; - - // A set of overloads for each cv-qualification. The same argument - // is passed twice: the first one is used to unwind the cv*, and the - // second one is used to avoid relying on partial ordering for - // overload resolution. - template - typename is_object_manager_help - is_object_manager_helper(U*, void*); - - template - typename is_object_manager_help - is_object_manager_helper(U const*, void const*); - - template - typename is_object_manager_help - is_object_manager_helper(U volatile*, void volatile*); - - template - typename is_object_manager_help - is_object_manager_helper(U const volatile*, void const volatile*); - - template - struct is_reference_to_object_manager_nonref - : mpl::false_ - { - }; - - template - struct is_reference_to_object_manager_ref - { - static T sample_object; - BOOST_STATIC_CONSTANT( - bool, value - = (sizeof(is_object_manager_helper(&sample_object, &sample_object).call()) - == sizeof(detail::yes_reference_to_object_manager) - ) - ); - typedef mpl::bool_ type; - }; -} - -template -struct is_reference_to_object_manager - : mpl::if_< - is_reference - , detail::is_reference_to_object_manager_ref - , detail::is_reference_to_object_manager_nonref - >::type -{ -}; -# endif }}} // namespace boost::python::converter diff --git a/include/boost/python/converter/registered.hpp b/include/boost/python/converter/registered.hpp index 2404cb0f..68bb3c4a 100644 --- a/include/boost/python/converter/registered.hpp +++ b/include/boost/python/converter/registered.hpp @@ -44,8 +44,7 @@ struct registered { }; -# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ - && !BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310)) +# if !BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310)) // collapses a few more types to the same static instance. MSVC7.1 // fails to strip cv-qualification from array types in typeid. For // some reason we can't use this collapse there or array converters diff --git a/include/boost/python/converter/registered_pointee.hpp b/include/boost/python/converter/registered_pointee.hpp index d9e7ac75..974cb6d8 100644 --- a/include/boost/python/converter/registered_pointee.hpp +++ b/include/boost/python/converter/registered_pointee.hpp @@ -14,7 +14,6 @@ namespace boost { namespace python { namespace converter { struct registration; -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct registered_pointee : registered< @@ -26,37 +25,6 @@ struct registered_pointee > { }; -# else -namespace detail -{ - template - struct registered_pointee_base - { - static registration const& converters; - }; -} - -template -struct registered_pointee - : detail::registered_pointee_base< - typename add_reference< - typename add_cv::type - >::type - > -{ -}; - -// -// implementations -// -namespace detail -{ - template - registration const& registered_pointee_base::converters - = registry::lookup(pointer_type_id()); -} - -# endif }}} // namespace boost::python::converter #endif // REGISTERED_POINTEE_DWA2002710_HPP diff --git a/include/boost/python/copy_const_reference.hpp b/include/boost/python/copy_const_reference.hpp index 19e3b423..55bede13 100644 --- a/include/boost/python/copy_const_reference.hpp +++ b/include/boost/python/copy_const_reference.hpp @@ -16,7 +16,7 @@ namespace detail { template struct copy_const_reference_expects_a_const_reference_return_type -# if defined(__GNUC__) && __GNUC__ >= 3 || defined(__EDG__) +# if defined(__GNUC__) || defined(__EDG__) {} # endif ; diff --git a/include/boost/python/copy_non_const_reference.hpp b/include/boost/python/copy_non_const_reference.hpp index 78b70f5d..15fef62d 100644 --- a/include/boost/python/copy_non_const_reference.hpp +++ b/include/boost/python/copy_non_const_reference.hpp @@ -16,7 +16,7 @@ namespace detail { template struct copy_non_const_reference_expects_a_non_const_reference_return_type -# if defined(__GNUC__) && __GNUC__ >= 3 || defined(__EDG__) +# if defined(__GNUC__) || defined(__EDG__) {} # endif ; diff --git a/include/boost/python/data_members.hpp b/include/boost/python/data_members.hpp index b0851fb1..139bde32 100644 --- a/include/boost/python/data_members.hpp +++ b/include/boost/python/data_members.hpp @@ -270,7 +270,7 @@ inline object make_getter(D& x) return detail::make_getter(x, policy, is_member_pointer(), 0L); } -# if !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) && !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) +# if !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) template inline object make_getter(D const& d) { @@ -305,7 +305,7 @@ inline object make_setter(D& x) return detail::make_setter(x, default_call_policies(), is_member_pointer(), 0); } -# if !(BOOST_WORKAROUND(BOOST_MSVC, <= 1300) || BOOST_WORKAROUND(__EDG_VERSION__, <= 238)) +# if BOOST_WORKAROUND(__EDG_VERSION__, <= 238) template inline object make_setter(D const& x) { diff --git a/include/boost/python/default_call_policies.hpp b/include/boost/python/default_call_policies.hpp index 3d32d2eb..fcc242a9 100644 --- a/include/boost/python/default_call_policies.hpp +++ b/include/boost/python/default_call_policies.hpp @@ -23,7 +23,7 @@ namespace detail { // for "readable" error messages template struct specify_a_return_value_policy_to_wrap_functions_returning -# if defined(__GNUC__) && __GNUC__ >= 3 || defined(__EDG__) +# if defined(__GNUC__) || defined(__EDG__) {} # endif ; diff --git a/include/boost/python/detail/borrowed_ptr.hpp b/include/boost/python/detail/borrowed_ptr.hpp old mode 100755 new mode 100644 index b88457b8..d91d05c9 --- a/include/boost/python/detail/borrowed_ptr.hpp +++ b/include/boost/python/detail/borrowed_ptr.hpp @@ -19,7 +19,6 @@ template class borrowed typedef T type; }; -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct is_borrowed_ptr { @@ -68,35 +67,6 @@ struct is_borrowed_ptr }; # endif -# else // no partial specialization - -typedef char (&yes_borrowed_ptr_t)[1]; -typedef char (&no_borrowed_ptr_t)[2]; - -no_borrowed_ptr_t is_borrowed_ptr_test(...); - -template -typename mpl::if_c< - is_pointer::value - , T - , int - >::type -is_borrowed_ptr_test1(boost::type); - -template -yes_borrowed_ptr_t is_borrowed_ptr_test(borrowed const volatile*); - -template -class is_borrowed_ptr -{ - public: - BOOST_STATIC_CONSTANT( - bool, value = ( - sizeof(detail::is_borrowed_ptr_test(is_borrowed_ptr_test1(boost::type()))) - == sizeof(detail::yes_borrowed_ptr_t))); -}; - -# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION } diff --git a/include/boost/python/detail/config.hpp b/include/boost/python/detail/config.hpp index 76595ebb..1857d39a 100644 --- a/include/boost/python/detail/config.hpp +++ b/include/boost/python/detail/config.hpp @@ -29,9 +29,6 @@ # endif # if defined(BOOST_MSVC) -# if _MSC_VER < 1300 -# define BOOST_MSVC6_OR_EARLIER 1 -# endif # pragma warning (disable : 4786) // disable truncated debug symbols # pragma warning (disable : 4251) // disable exported dll function diff --git a/include/boost/python/detail/construct.hpp b/include/boost/python/detail/construct.hpp index 5f15d22c..e69fbc75 100644 --- a/include/boost/python/detail/construct.hpp +++ b/include/boost/python/detail/construct.hpp @@ -8,13 +8,7 @@ namespace boost { namespace python { namespace detail { template -void construct_pointee(void* storage, Arg& x -# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 - , T const volatile* -# else - , T const* -# endif - ) +void construct_pointee(void* storage, Arg& x, T const volatile*) { new (storage) T(x); } diff --git a/include/boost/python/detail/cv_category.hpp b/include/boost/python/detail/cv_category.hpp index 1765b36f..d32dd0fd 100644 --- a/include/boost/python/detail/cv_category.hpp +++ b/include/boost/python/detail/cv_category.hpp @@ -12,7 +12,7 @@ template struct cv_tag { BOOST_STATIC_CONSTANT(bool, is_const = is_const_); - BOOST_STATIC_CONSTANT(bool, is_volatile = is_const_); + BOOST_STATIC_CONSTANT(bool, is_volatile = is_volatile_); }; typedef cv_tag cv_unqualified; diff --git a/include/boost/python/detail/destroy.hpp b/include/boost/python/detail/destroy.hpp index 0172dca2..3ea64553 100644 --- a/include/boost/python/detail/destroy.hpp +++ b/include/boost/python/detail/destroy.hpp @@ -7,25 +7,12 @@ # include # include -# if BOOST_WORKAROUND(BOOST_MSVC, == 1300) -# include -# endif namespace boost { namespace python { namespace detail { -template < - bool array -# if BOOST_WORKAROUND(BOOST_MSVC, == 1300) - , bool enum_ // vc7 has a problem destroying enums -# endif - > struct value_destroyer; +template struct value_destroyer; template <> -struct value_destroyer< - false -# if BOOST_WORKAROUND(BOOST_MSVC, == 1300) - , false -# endif - > +struct value_destroyer { template static void execute(T const volatile* p) @@ -35,12 +22,7 @@ struct value_destroyer< }; template <> -struct value_destroyer< - true -# if BOOST_WORKAROUND(BOOST_MSVC, == 1300) - , false -# endif - > +struct value_destroyer { template static void execute(A*, T const volatile* const first) @@ -49,9 +31,6 @@ struct value_destroyer< { value_destroyer< boost::is_array::value -# if BOOST_WORKAROUND(BOOST_MSVC, == 1300) - , boost::is_enum::value -# endif >::execute(p); } } @@ -63,25 +42,6 @@ struct value_destroyer< } }; -# if BOOST_WORKAROUND(BOOST_MSVC, == 1300) -template <> -struct value_destroyer -{ - template - static void execute(T const volatile*) - { - } -}; - -template <> -struct value_destroyer -{ - template - static void execute(T const volatile*) - { - } -}; -# endif template inline void destroy_referent_impl(void* p, T& (*)()) { @@ -89,9 +49,6 @@ inline void destroy_referent_impl(void* p, T& (*)()) // must come *before* T for metrowerks value_destroyer< (boost::is_array::value) -# if BOOST_WORKAROUND(BOOST_MSVC, == 1300) - , (boost::is_enum::value) -# endif >::execute((const volatile T*)p); } diff --git a/include/boost/python/detail/enable_if.hpp b/include/boost/python/detail/enable_if.hpp old mode 100755 new mode 100644 index 46a1d532..7a37be12 --- a/include/boost/python/detail/enable_if.hpp +++ b/include/boost/python/detail/enable_if.hpp @@ -7,40 +7,7 @@ # include # include -# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) -# include - -namespace boost { namespace python { namespace detail { - -template struct always_void { typedef void type; }; - -template -struct enable_if_arg -{ - typedef typename mpl::if_::type type; -}; - -template -struct disable_if_arg -{ - typedef typename mpl::if_::type type; -}; - -template ::type> -struct enable_if_ret -{ - typedef typename mpl::if_::type type; -}; - -template ::type> -struct disable_if_ret -{ - typedef typename mpl::if_::type type; -}; - -}}} // namespace boost::python::detail - -# elif !defined(BOOST_NO_SFINAE) +#if !defined(BOOST_NO_SFINAE) # include namespace boost { namespace python { namespace detail { diff --git a/include/boost/python/detail/force_instantiate.hpp b/include/boost/python/detail/force_instantiate.hpp old mode 100755 new mode 100644 index 63e28749..a8901b2d --- a/include/boost/python/detail/force_instantiate.hpp +++ b/include/boost/python/detail/force_instantiate.hpp @@ -10,23 +10,9 @@ namespace boost { namespace python { namespace detail { // Allows us to force the argument to be instantiated without // incurring unused variable warnings -# if !defined(BOOST_MSVC) || BOOST_MSVC < 1300 || _MSC_FULL_VER > 13102196 - template inline void force_instantiate(T const&) {} -# else - -# pragma optimize("g", off) -inline void force_instantiate_impl(...) {} -# pragma optimize("", on) -template -inline void force_instantiate(T const& x) -{ - detail::force_instantiate_impl(&x); -} -# endif - }}} // namespace boost::python::detail #endif // FORCE_INSTANTIATE_DWA200265_HPP diff --git a/include/boost/python/detail/if_else.hpp b/include/boost/python/detail/if_else.hpp index 244e63a8..3f505c5e 100644 --- a/include/boost/python/detail/if_else.hpp +++ b/include/boost/python/detail/if_else.hpp @@ -25,46 +25,11 @@ struct if_selected }; }; -# if defined(BOOST_MSVC) && (BOOST_MSVC == 1300) -namespace msvc70_aux { - -template< bool > struct inherit_from -{ - template< typename T > struct result - { - typedef T type; - }; -}; - -template<> struct inherit_from -{ - template< typename T > struct result - { - struct type {}; - }; -}; - -template< typename T > -struct never_true -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; - -} // namespace msvc70_aux - -#endif // # if defined(BOOST_MSVC) && (BOOST_MSVC == 1300) - template struct elif_selected { -# if !(defined(BOOST_MSVC) && BOOST_MSVC <= 1300 || defined(__MWERKS__) && __MWERKS__ <= 0x2407) +# if !(defined(__MWERKS__) && __MWERKS__ <= 0x2407) template class then; -# elif defined(BOOST_MSVC) && (BOOST_MSVC == 1300) - template - struct then : msvc70_aux::inherit_from< msvc70_aux::never_true::value > - ::template result< if_selected >::type - { - }; # else template struct then : if_selected @@ -73,7 +38,7 @@ struct elif_selected # endif }; -# if !(defined(BOOST_MSVC) && BOOST_MSVC <= 1300 || defined(__MWERKS__) && __MWERKS__ <= 0x2407) +# if !(defined(__MWERKS__) && __MWERKS__ <= 0x2407) template template class elif_selected::then : public if_selected diff --git a/include/boost/python/detail/msvc_typeinfo.hpp b/include/boost/python/detail/msvc_typeinfo.hpp index 10f84505..bfc84164 100644 --- a/include/boost/python/detail/msvc_typeinfo.hpp +++ b/include/boost/python/detail/msvc_typeinfo.hpp @@ -7,15 +7,18 @@ #include #include -#include // -// Fix for MSVC's broken typeid() implementation which doesn't strip +// Fix for icc's broken typeid() implementation which doesn't strip // decoration. This fix doesn't handle cv-qualified array types. It // could probably be done, but I haven't figured it out yet. // -# if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 || defined(BOOST_INTEL_CXX_VERSION) && BOOST_INTEL_CXX_VERSION <= 700 +// Note: This file is badly named. It initially was MSVC specific, but was +// extended to cover intel too. Now the old version of MSVC is no longer +// supported, but the intel version is still supported. + +# if defined(BOOST_INTEL_CXX_VERSION) && BOOST_INTEL_CXX_VERSION <= 700 namespace boost { namespace python { namespace detail { @@ -44,8 +47,14 @@ inline typeinfo typeid_ref(type*, ...) return detail::typeid_ref_1((T(*)())0); } +#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32)) +# define BOOST_PYTT_DECL __cdecl +#else +# define BOOST_PYTT_DECL /**/ +#endif + template< typename T > T&(* is_ref_tester1(type) )(type) { return 0; } -inline char BOOST_TT_DECL is_ref_tester1(...) { return 0; } +inline char BOOST_PYTT_DECL is_ref_tester1(...) { return 0; } template inline typeinfo msvc_typeid(boost::type*) @@ -71,5 +80,5 @@ inline typeinfo assert_array_typeid_compiles() }}} // namespace boost::python::detail -# endif // BOOST_MSVC +# endif // BOOST_INTEL_CXX_VERSION #endif // MSVC_TYPEINFO_DWA200222_HPP diff --git a/include/boost/python/detail/referent_storage.hpp b/include/boost/python/detail/referent_storage.hpp index 0a1ef5a0..2cddf696 100644 --- a/include/boost/python/detail/referent_storage.hpp +++ b/include/boost/python/detail/referent_storage.hpp @@ -42,7 +42,6 @@ union aligned_storage // but sizeof() is broken in CodeWarriors <= 8.0 template struct referent_size; -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct referent_size @@ -51,15 +50,6 @@ union aligned_storage std::size_t, value = sizeof(T)); }; -# else - - template struct referent_size - { - static T f(); - BOOST_STATIC_CONSTANT(std::size_t, value = sizeof(f())); - }; - -# endif // A metafunction returning a POD type which can store U, where T == // U&. If T is not a reference type, returns a POD which can store T. diff --git a/include/boost/python/detail/result.hpp b/include/boost/python/detail/result.hpp index 9b8b4864..8ccc3c50 100644 --- a/include/boost/python/detail/result.hpp +++ b/include/boost/python/detail/result.hpp @@ -43,9 +43,7 @@ namespace boost { namespace python { namespace detail { template boost::type* result(R (T::*), int = 0) { return 0; } -# if (defined(BOOST_MSVC) && _MSC_FULL_VER <= 13102140) \ - || (defined(__GNUC__) && __GNUC__ < 3) \ - || (defined(__MWERKS__) && __MWERKS__ < 0x3000) +# if (defined(__MWERKS__) && __MWERKS__ < 0x3000) // This code actually works on all implementations, but why use it when we don't have to? template struct get_result_type diff --git a/include/boost/python/detail/string_literal.hpp b/include/boost/python/detail/string_literal.hpp index 50193b64..a56e72ec 100644 --- a/include/boost/python/detail/string_literal.hpp +++ b/include/boost/python/detail/string_literal.hpp @@ -14,7 +14,6 @@ namespace boost { namespace python { namespace detail { -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct is_string_literal : mpl::false_ { @@ -45,43 +44,6 @@ struct is_string_literal { }; # endif -# else -template -struct string_literal_helper -{ - typedef char (&yes_string_literal)[1]; - typedef char (&no_string_literal)[2]; - - template - struct apply - { - typedef apply self; - static T x; - static yes_string_literal check(char const*); - static no_string_literal check(char*); - static no_string_literal check(void const volatile*); - - BOOST_STATIC_CONSTANT( - bool, value = sizeof(self::check(x)) == sizeof(yes_string_literal)); - typedef mpl::bool_ type; - }; -}; - -template <> -struct string_literal_helper -{ - template - struct apply : mpl::false_ - { - }; -}; - -template -struct is_string_literal - : string_literal_helper::value>::apply -{ -}; -# endif }}} // namespace boost::python::detail diff --git a/include/boost/python/detail/type_list.hpp b/include/boost/python/detail/type_list.hpp index 9483c194..0ad3f63d 100644 --- a/include/boost/python/detail/type_list.hpp +++ b/include/boost/python/detail/type_list.hpp @@ -30,10 +30,6 @@ # include # endif -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION # include -# else -# include -# endif #endif // TYPE_LIST_DWA2002913_HPP diff --git a/include/boost/python/detail/type_list_impl_no_pts.hpp b/include/boost/python/detail/type_list_impl_no_pts.hpp deleted file mode 100644 index 15d92523..00000000 --- a/include/boost/python/detail/type_list_impl_no_pts.hpp +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef BOOST_PP_IS_ITERATING -// Copyright David Abrahams 2002. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -# ifndef TYPE_LIST_IMPL_NO_PTS_DWA2002913_HPP -# define TYPE_LIST_IMPL_NO_PTS_DWA2002913_HPP - -# include - -# include -# include -# include -# include -# include -# include -# include - -namespace boost { namespace python { namespace detail { - -template< typename T > -struct is_list_arg -{ - enum { value = true }; -}; - -template<> -struct is_list_arg -{ - enum { value = false }; -}; - -template struct type_list_impl_chooser; - -# define BOOST_PYTHON_LIST_ACTUAL_PARAMS BOOST_PP_ENUM_PARAMS_Z(1,BOOST_PYTHON_LIST_SIZE,T) -# define BOOST_PYTHON_LIST_FORMAL_PARAMS BOOST_PP_ENUM_PARAMS_Z(1,BOOST_PYTHON_LIST_SIZE,class T) - -# define BOOST_PP_ITERATION_PARAMS_1 \ - (3, (0, BOOST_PYTHON_LIST_SIZE, )) -# include BOOST_PP_ITERATE() - -# define BOOST_PYTHON_PLUS() + -# define BOOST_PYTHON_IS_LIST_ARG(z, n, data) \ - BOOST_PP_IF(n, BOOST_PYTHON_PLUS, BOOST_PP_EMPTY)() \ - is_list_arg< BOOST_PP_CAT(T,n) >::value - -template< - BOOST_PYTHON_LIST_FORMAL_PARAMS - > -struct type_list_count_args -{ - enum { value = - BOOST_PP_REPEAT_1(BOOST_PYTHON_LIST_SIZE, BOOST_PYTHON_IS_LIST_ARG, _) - }; -}; - -template< - BOOST_PYTHON_LIST_FORMAL_PARAMS - > -struct type_list_impl -{ - typedef type_list_count_args< BOOST_PYTHON_LIST_ACTUAL_PARAMS > arg_num_; - typedef typename detail::type_list_impl_chooser< arg_num_::value > - ::template result_< BOOST_PYTHON_LIST_ACTUAL_PARAMS >::type type; -}; - -template< - BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PYTHON_LIST_SIZE, class T, mpl::void_) - > -struct type_list - : detail::type_list_impl< BOOST_PYTHON_LIST_ACTUAL_PARAMS >::type -{ - typedef typename detail::type_list_impl< - BOOST_PYTHON_LIST_ACTUAL_PARAMS - >::type type; -}; - -# undef BOOST_PYTHON_IS_LIST_ARG -# undef BOOST_PYTHON_PLUS -# undef BOOST_PYTHON_LIST_FORMAL_PARAMS -# undef BOOST_PYTHON_LIST_ACTUAL_PARAMS - -}}} // namespace boost::python::detail - -# endif // TYPE_LIST_IMPL_NO_PTS_DWA2002913_HPP - -#else // BOOST_PP_IS_ITERATING - -# define N BOOST_PP_ITERATION() - -template<> -struct type_list_impl_chooser -{ - template< - BOOST_PYTHON_LIST_FORMAL_PARAMS - > - struct result_ - { - typedef typename BOOST_PP_CAT(mpl::vector,N)< - BOOST_PP_ENUM_PARAMS(N, T) - >::type type; - }; -}; - -# undef N - -#endif // BOOST_PP_IS_ITERATING diff --git a/include/boost/python/detail/value_is_xxx.hpp b/include/boost/python/detail/value_is_xxx.hpp index 2b125649..fbb9defd 100644 --- a/include/boost/python/detail/value_is_xxx.hpp +++ b/include/boost/python/detail/value_is_xxx.hpp @@ -9,35 +9,6 @@ # include # include -# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) -# include -# include - -# define BOOST_PYTHON_VALUE_IS_XXX_DEF(name, qualified_name, nargs) \ -template \ -struct value_is_##name \ -{ \ - typedef char yes; \ - typedef char (&no)[2]; \ - \ - static typename add_reference::type dummy; \ - \ - template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class U) > \ - static yes test( \ - qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, U) > const&, int \ - ); \ - \ - template \ - static no test(U&, ...); \ - \ - BOOST_STATIC_CONSTANT( \ - bool, value \ - = (sizeof(test(dummy, 0)) == sizeof(yes))); \ - \ - typedef mpl::bool_ type; \ -}; - -# else # include # include @@ -57,6 +28,5 @@ struct value_is_##name \ \ }; -# endif #endif // VALUE_IS_XXX_DWA2003224_HPP diff --git a/include/boost/python/extract.hpp b/include/boost/python/extract.hpp index 544c61f0..bfdeb83c 100644 --- a/include/boost/python/extract.hpp +++ b/include/boost/python/extract.hpp @@ -21,8 +21,7 @@ # include # include -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) || BOOST_WORKAROUND(BOOST_INTEL_WIN, <= 900) -// workaround for VC++ 6.x or 7.0 +#if BOOST_WORKAROUND(BOOST_INTEL_WIN, <= 900) # define BOOST_EXTRACT_WORKAROUND () #else # define BOOST_EXTRACT_WORKAROUND diff --git a/include/boost/python/handle.hpp b/include/boost/python/handle.hpp old mode 100755 new mode 100644 index 461a219a..ee9a7cd0 --- a/include/boost/python/handle.hpp +++ b/include/boost/python/handle.hpp @@ -87,8 +87,6 @@ class handle return *this; } -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1300) - template handle& operator=(handle const & r) // never throws { @@ -97,8 +95,6 @@ class handle return *this; } -#endif - template handle(handle const& r) : m_p(python::xincref(python::upcast(r.get()))) @@ -159,7 +155,6 @@ typedef handle type_handle; // // Compile-time introspection // -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template class is_handle { @@ -173,28 +168,6 @@ class is_handle > public: BOOST_STATIC_CONSTANT(bool, value = true); }; -# else -namespace detail -{ - typedef char (&yes_handle_t)[1]; - typedef char (&no_handle_t)[2]; - - no_handle_t is_handle_test(...); - - template - yes_handle_t is_handle_test(boost::type< handle >); -} - -template -class is_handle -{ - public: - BOOST_STATIC_CONSTANT( - bool, value = ( - sizeof(detail::is_handle_test(boost::type())) - == sizeof(detail::yes_handle_t))); -}; -# endif // // implementations diff --git a/include/boost/python/init.hpp b/include/boost/python/init.hpp index 6598fd35..b82ab01e 100644 --- a/include/boost/python/init.hpp +++ b/include/boost/python/init.hpp @@ -76,27 +76,6 @@ namespace detail // // This metaprogram checks if T is an optional // -#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - - template - struct is_optional { - - private: - - template - static boost::type_traits::yes_type f(optional); - static boost::type_traits::no_type f(...); - static T t(); - - public: - - BOOST_STATIC_CONSTANT( - bool, value = - sizeof(f(t())) == sizeof(::boost::type_traits::yes_type)); - typedef mpl::bool_ type; - }; - -#else template struct is_optional @@ -108,7 +87,6 @@ namespace detail : mpl::true_ {}; -#endif template struct define_class_init_helper; diff --git a/include/boost/python/make_constructor.hpp b/include/boost/python/make_constructor.hpp index 8ae722bb..47cdf469 100644 --- a/include/boost/python/make_constructor.hpp +++ b/include/boost/python/make_constructor.hpp @@ -104,14 +104,6 @@ namespace detail // If the BasePolicy_ supplied a result converter it would be // ignored; issue an error if it's not the default. -#if defined _MSC_VER && _MSC_VER < 1300 - typedef is_same< - typename BasePolicy_::result_converter - , default_result_converter - > same_result_converter; - //see above for explanation - BOOST_STATIC_ASSERT(same_result_converter::value) ; -#else BOOST_MPL_ASSERT_MSG( (is_same< typename BasePolicy_::result_converter @@ -120,7 +112,6 @@ namespace detail , MAKE_CONSTRUCTOR_SUPPLIES_ITS_OWN_RESULT_CONVERTER_THAT_WOULD_OVERRIDE_YOURS , (typename BasePolicy_::result_converter) ); -#endif typedef constructor_result_converter result_converter; typedef offset_args > argument_package; }; diff --git a/include/boost/python/manage_new_object.hpp b/include/boost/python/manage_new_object.hpp index d81421da..9585b13a 100644 --- a/include/boost/python/manage_new_object.hpp +++ b/include/boost/python/manage_new_object.hpp @@ -17,7 +17,7 @@ namespace detail { template struct manage_new_object_requires_a_pointer_return_type -# if defined(__GNUC__) && __GNUC__ >= 3 || defined(__EDG__) +# if defined(__GNUC__) || defined(__EDG__) {} # endif ; diff --git a/include/boost/python/object/class_metadata.hpp b/include/boost/python/object/class_metadata.hpp index 155ae35d..c71cf67c 100644 --- a/include/boost/python/object/class_metadata.hpp +++ b/include/boost/python/object/class_metadata.hpp @@ -53,11 +53,7 @@ struct register_base_of template inline void operator()(Base*) const { -# if !BOOST_WORKAROUND(BOOST_MSVC, == 1200) BOOST_MPL_ASSERT_NOT((is_same)); -# else - BOOST_STATIC_ASSERT(!(is_same::value)); -# endif // Register the Base class register_dynamic_id(); diff --git a/include/boost/python/object/forward.hpp b/include/boost/python/object/forward.hpp index 2faf3321..30613d8e 100644 --- a/include/boost/python/object/forward.hpp +++ b/include/boost/python/object/forward.hpp @@ -12,13 +12,7 @@ # include # include # include -# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) -# include -# include -# include -# else -# include -# endif +# include namespace boost { namespace python { namespace objects { @@ -42,24 +36,13 @@ struct reference_to_value template struct forward : mpl::if_< -# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - // vc6 chokes on unforwarding enums nested in classes - mpl::and_< - is_scalar - , mpl::not_< - is_enum - > - > -# else mpl::or_, is_scalar > -# endif , T , reference_to_value > { }; -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct unforward { @@ -86,88 +69,6 @@ struct unforward_cref > { }; -# else // no partial specialization - -namespace detail -{ - typedef char (&yes_reference_to_value_t)[1]; - typedef char (&no_reference_to_value_t)[2]; - - no_reference_to_value_t is_reference_to_value_test(...); - - template - yes_reference_to_value_t is_reference_to_value_test(boost::type< reference_to_value >); - - template - struct unforwarder - { - template - struct apply - { - typedef typename unwrap_reference::type& type; - }; - }; - - template<> - struct unforwarder - { - template - struct apply - { - typedef typename T::reference type; - }; - }; - - template - struct cref_unforwarder - { - template - struct apply - : python::detail::value_arg< - typename unwrap_reference::type - > - { - }; - }; - - template<> - struct cref_unforwarder - { - template - struct apply - : python::detail::value_arg< - typename T::reference - > - { - }; - }; - - template - struct is_reference_to_value - { - BOOST_STATIC_CONSTANT( - bool, value = ( - sizeof(is_reference_to_value_test(boost::type())) - == sizeof(yes_reference_to_value_t))); - typedef mpl::bool_ type; - }; -} - -template -struct unforward - : public detail::unforwarder< - detail::is_reference_to_value::value - >::template apply -{}; - -template -struct unforward_cref - : public detail::cref_unforwarder< - detail::is_reference_to_value::value - >::template apply -{}; - -# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template typename reference_to_value::reference diff --git a/include/boost/python/object/iterator.hpp b/include/boost/python/object/iterator.hpp index ab748fe8..db522471 100644 --- a/include/boost/python/object/iterator.hpp +++ b/include/boost/python/object/iterator.hpp @@ -71,35 +71,7 @@ struct iterator_range # endif }; -# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - // for compilers which can't deduce the value_type of pointers, we - // have a special implementation of next. This takes advantage of - // the fact that T* results are treated like T& results by - // Boost.Python's function wrappers. - struct next_ptr - { - typedef Iterator result_type; - - result_type - operator()(iterator_range& self) - { - if (self.m_start == self.m_finish) - stop_iteration_error(); - return self.m_start++; - } - }; - - typedef mpl::if_< - is_same< - boost::detail::please_invoke_BOOST_TT_BROKEN_COMPILER_SPEC_on_cv_unqualified_pointee - , typename traits_t::value_type - > - , next_ptr - , next - >::type next_fn; -# else typedef next next_fn; -# endif object m_sequence; // Keeps the sequence alive while iterating. Iterator m_start; diff --git a/include/boost/python/object/pointer_holder.hpp b/include/boost/python/object/pointer_holder.hpp index 4627e34a..27d95193 100644 --- a/include/boost/python/object/pointer_holder.hpp +++ b/include/boost/python/object/pointer_holder.hpp @@ -46,11 +46,7 @@ template class wrapper; namespace boost { namespace python { namespace objects { -# if BOOST_WORKAROUND(__GNUC__, == 2) -# define BOOST_PYTHON_UNFORWARD_LOCAL(z, n, _) BOOST_PP_COMMA_IF(n) (typename unforward::type)objects::do_unforward(a##n,0) -# else -# define BOOST_PYTHON_UNFORWARD_LOCAL(z, n, _) BOOST_PP_COMMA_IF(n) objects::do_unforward(a##n,0) -# endif +#define BOOST_PYTHON_UNFORWARD_LOCAL(z, n, _) BOOST_PP_COMMA_IF(n) objects::do_unforward(a##n,0) template struct pointer_holder : instance_holder diff --git a/include/boost/python/object/value_holder.hpp b/include/boost/python/object/value_holder.hpp index f4d452ca..a4e91786 100644 --- a/include/boost/python/object/value_holder.hpp +++ b/include/boost/python/object/value_holder.hpp @@ -33,11 +33,7 @@ namespace boost { namespace python { namespace objects { -# if BOOST_WORKAROUND(__GNUC__, == 2) -# define BOOST_PYTHON_UNFORWARD_LOCAL(z, n, _) BOOST_PP_COMMA_IF(n) (typename unforward::type)objects::do_unforward(a##n,0) -# else -# define BOOST_PYTHON_UNFORWARD_LOCAL(z, n, _) BOOST_PP_COMMA_IF(n) objects::do_unforward(a##n,0) -# endif +#define BOOST_PYTHON_UNFORWARD_LOCAL(z, n, _) BOOST_PP_COMMA_IF(n) objects::do_unforward(a##n,0) template struct value_holder : instance_holder diff --git a/include/boost/python/object_core.hpp b/include/boost/python/object_core.hpp index 9c9dc10b..61857796 100644 --- a/include/boost/python/object_core.hpp +++ b/include/boost/python/object_core.hpp @@ -36,12 +36,6 @@ # include # include -# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) -# include -# endif - -# include - namespace boost { namespace python { namespace detail @@ -98,11 +92,7 @@ namespace api class object_operators : public def_visitor { protected: -# if !defined(BOOST_MSVC) || BOOST_MSVC >= 1300 typedef object const& object_cref; -# else - typedef object object_cref; -# endif public: // function call // @@ -139,25 +129,11 @@ namespace api template const_object_item - operator[](T const& key) const -# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 - ; -# else - { - return (*this)[object(key)]; - } -# endif + operator[](T const& key) const; template object_item - operator[](T const& key) -# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 - ; -# else - { - return (*this)[object(key)]; - } -# endif + operator[](T const& key); // slicing // @@ -175,29 +151,11 @@ namespace api template const_object_slice - slice(T const& start, V const& end) const -# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 - ; -# else - { - return this->slice( - slice_bound::type(start) - , slice_bound::type(end)); - } -# endif + slice(T const& start, V const& end) const; template object_slice - slice(T const& start, V const& end) -# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 - ; -# else - { - return this->slice( - slice_bound::type(start) - , slice_bound::type(end)); - } -# endif + slice(T const& start, V const& end); private: // def visitation for adding callable objects as class methods @@ -248,26 +206,6 @@ namespace api PyObject* m_ptr; }; -# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - template - struct is_derived_impl - { - static T x; - template - static X* to_pointer(X const&); - - static char test(U const*); - typedef char (&no)[2]; - static no test(...); - - BOOST_STATIC_CONSTANT(bool, value = sizeof(test(to_pointer(x))) == 1); - }; - - template - struct is_derived - : mpl::bool_::value> - {}; -# else template struct is_derived : is_convertible< @@ -275,28 +213,13 @@ namespace api , U const* > {}; -# endif template typename objects::unforward_cref::type do_unforward_cref(T const& x) { -# if BOOST_WORKAROUND(__GNUC__, == 2) - typedef typename objects::unforward_cref::type ret; - return ret(x); -# else return x; -# endif } -# if BOOST_WORKAROUND(__GNUC__, == 2) - // GCC 2.x has non-const string literals; this hacks around that problem. - template - char const (& do_unforward_cref(char const(&x)[N]) )[N] - { - return x; - } -# endif - class object; template @@ -323,14 +246,7 @@ namespace api // explicit conversion from any C++ object to Python template - explicit object( - T const& x -# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - // use some SFINAE to un-confuse MSVC about its - // copy-initialization ambiguity claim. - , typename mpl::if_,int&,int>::type* = 0 -# endif - ) + explicit object(T const& x) : object_base(object_base_initializer(x)) { } @@ -348,7 +264,7 @@ namespace api // Macros for forwarding constructors in classes derived from // object. Derived classes will usually want these as an // implementation detail -# define BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS_(derived, base) \ +# define BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(derived, base) \ inline explicit derived(::boost::python::detail::borrowed_reference p) \ : base(p) {} \ inline explicit derived(::boost::python::detail::new_reference p) \ @@ -356,23 +272,6 @@ namespace api inline explicit derived(::boost::python::detail::new_non_null_reference p) \ : base(p) {} -# if !defined(BOOST_MSVC) || BOOST_MSVC >= 1300 -# define BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS_ -# else - // MSVC6 has a bug which causes an explicit template constructor to - // be preferred over an appropriate implicit conversion operator - // declared on the argument type. Normally, that would cause a - // runtime failure when using extract to extract a type with a - // templated constructor. This additional constructor will turn that - // runtime failure into an ambiguity error at compile-time due to - // the lack of partial ordering, or at least a link-time error if no - // generalized template constructor is declared. -# define BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(derived, base) \ - BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS_(derived, base) \ - template \ - explicit derived(extract const&); -# endif - // // object_initializer -- get the handle to construct the object with, // based on whether T is a proxy or derived from object diff --git a/include/boost/python/object_items.hpp b/include/boost/python/object_items.hpp old mode 100755 new mode 100644 index f0761dad..b048689a --- a/include/boost/python/object_items.hpp +++ b/include/boost/python/object_items.hpp @@ -44,7 +44,6 @@ object_operators::operator[](object_cref key) const return const_object_item(x, key); } -# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 template template inline const_object_item @@ -60,8 +59,6 @@ object_operators::operator[](T const& key) { return (*this)[object(key)]; } -# endif - inline object const_item_policies::get(object const& target, object const& key) { diff --git a/include/boost/python/object_slices.hpp b/include/boost/python/object_slices.hpp index 748c2e95..6cd3dc29 100644 --- a/include/boost/python/object_slices.hpp +++ b/include/boost/python/object_slices.hpp @@ -99,7 +99,7 @@ object_operators::slice(object_cref start, slice_nil) const object_cref2 x = *static_cast(this); return const_object_slice(x, api::slice_key(borrowed(start.ptr()), allow_null((PyObject*)0))); } -# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 + template template inline const_object_slice @@ -119,8 +119,6 @@ object_operators::slice(T const& start, V const& end) typename slice_bound::type(start) , typename slice_bound::type(end)); } -# endif - inline object const_slice_policies::get(object const& target, key_type const& key) { diff --git a/include/boost/python/opaque_pointer_converter.hpp b/include/boost/python/opaque_pointer_converter.hpp index 10eb4234..e95c49bb 100644 --- a/include/boost/python/opaque_pointer_converter.hpp +++ b/include/boost/python/opaque_pointer_converter.hpp @@ -172,28 +172,19 @@ PyTypeObject opaque::type_object = }; }} // namespace boost::python -# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - -# define BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(Pointee) - -# else - // If you change the below, don't forget to alter the end of type_id.hpp # define BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(Pointee) \ namespace boost { namespace python { \ template<> \ - inline type_info type_id(BOOST_PYTHON_EXPLICIT_TT_DEF(Pointee)) \ + inline type_info type_id() \ { \ return type_info (typeid (Pointee *)); \ } \ template<> \ - inline type_info type_id( \ - BOOST_PYTHON_EXPLICIT_TT_DEF(const volatile Pointee&)) \ + inline type_info type_id() \ { \ return type_info (typeid (Pointee *)); \ } \ }} -# endif - # endif // OPAQUE_POINTER_CONVERTER_HPP_ diff --git a/include/boost/python/other.hpp b/include/boost/python/other.hpp old mode 100755 new mode 100644 index eeece99b..24a24ad8 --- a/include/boost/python/other.hpp +++ b/include/boost/python/other.hpp @@ -7,9 +7,7 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -# if _MSC_VER+0 >= 1020 -# pragma once -# endif +# pragma once # include @@ -20,7 +18,6 @@ template struct other typedef T type; }; -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION namespace detail { template @@ -51,63 +48,6 @@ namespace detail typedef T type; }; } -# else // no partial specialization - -}} // namespace boost::python - -#include - -namespace boost { namespace python { - -namespace detail -{ - typedef char (&yes_other_t)[1]; - typedef char (&no_other_t)[2]; - - no_other_t is_other_test(...); - - template - yes_other_t is_other_test(type< other >); - - template - struct other_unwrapper - { - template - struct apply - { - typedef T type; - }; - }; - - template<> - struct other_unwrapper - { - template - struct apply - { - typedef typename T::type type; - }; - }; - - template - class is_other - { - public: - BOOST_STATIC_CONSTANT( - bool, value = ( - sizeof(detail::is_other_test(type())) - == sizeof(detail::yes_other_t))); - }; - - template - class unwrap_other - : public detail::other_unwrapper< - is_other::value - >::template apply - {}; -} - -# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION }} // namespace boost::python diff --git a/include/boost/python/proxy.hpp b/include/boost/python/proxy.hpp old mode 100755 new mode 100644 index a956eac1..d3331d56 --- a/include/boost/python/proxy.hpp +++ b/include/boost/python/proxy.hpp @@ -15,11 +15,7 @@ class proxy : public object_operators > { typedef typename Policies::key_type key_type; -# if !defined(BOOST_MSVC) || BOOST_MSVC >= 1300 typedef proxy const& assignment_self; -# else - typedef proxy assignment_self; -# endif public: proxy(object const& target, key_type const& key); operator object() const; diff --git a/include/boost/python/ptr.hpp b/include/boost/python/ptr.hpp index af1339c4..287daba4 100644 --- a/include/boost/python/ptr.hpp +++ b/include/boost/python/ptr.hpp @@ -11,9 +11,7 @@ // Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2001 Peter Dimov -# if _MSC_VER+0 >= 1020 -# pragma once -# endif +# pragma once # include # include @@ -38,7 +36,6 @@ inline pointer_wrapper ptr(T t) return pointer_wrapper(t); } -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template class is_pointer_wrapper : public mpl::false_ @@ -64,64 +61,6 @@ class unwrap_pointer > public: typedef T type; }; -# else // no partial specialization - -}} // namespace boost::python - -#include - -namespace boost { namespace python { - -namespace detail -{ - typedef char (&yes_pointer_wrapper_t)[1]; - typedef char (&no_pointer_wrapper_t)[2]; - - no_pointer_wrapper_t is_pointer_wrapper_test(...); - - template - yes_pointer_wrapper_t is_pointer_wrapper_test(boost::type< pointer_wrapper >); - - template - struct pointer_unwrapper - { - template - struct apply - { - typedef T type; - }; - }; - - template<> - struct pointer_unwrapper - { - template - struct apply - { - typedef typename T::type type; - }; - }; -} - -template -class is_pointer_wrapper -{ - public: - BOOST_STATIC_CONSTANT( - bool, value = ( - sizeof(detail::is_pointer_wrapper_test(boost::type())) - == sizeof(detail::yes_pointer_wrapper_t))); - typedef mpl::bool_ type; -}; - -template -class unwrap_pointer - : public detail::pointer_unwrapper< - is_pointer_wrapper::value - >::template apply -{}; - -# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION }} // namespace boost::python diff --git a/include/boost/python/pure_virtual.hpp b/include/boost/python/pure_virtual.hpp old mode 100755 new mode 100644 index b3b34ffc..58e9aede --- a/include/boost/python/pure_virtual.hpp +++ b/include/boost/python/pure_virtual.hpp @@ -47,7 +47,7 @@ namespace detail // replaced by void, and whose first argument is replaced by C&. template typename replace_front2::type - error_signature(S BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(C)) + error_signature(S) { typedef typename replace_front2::type r; return r(); diff --git a/include/boost/python/reference_existing_object.hpp b/include/boost/python/reference_existing_object.hpp index bb8ddf73..8c241071 100644 --- a/include/boost/python/reference_existing_object.hpp +++ b/include/boost/python/reference_existing_object.hpp @@ -17,7 +17,7 @@ namespace detail { template struct reference_existing_object_requires_a_pointer_or_reference_return_type -# if defined(__GNUC__) && __GNUC__ >= 3 || defined(__EDG__) +# if defined(__GNUC__) || defined(__EDG__) {} # endif ; diff --git a/include/boost/python/register_ptr_to_python.hpp b/include/boost/python/register_ptr_to_python.hpp index 7a22fe50..d39bd0cf 100644 --- a/include/boost/python/register_ptr_to_python.hpp +++ b/include/boost/python/register_ptr_to_python.hpp @@ -12,7 +12,7 @@ namespace boost { namespace python { template -void register_ptr_to_python(BOOST_EXPLICIT_TEMPLATE_TYPE(P)) +void register_ptr_to_python() { typedef typename boost::python::pointee

::type X; objects::class_value_wrapper< diff --git a/include/boost/python/return_arg.hpp b/include/boost/python/return_arg.hpp old mode 100755 new mode 100644 index c36f898d..e869a58d --- a/include/boost/python/return_arg.hpp +++ b/include/boost/python/return_arg.hpp @@ -29,7 +29,7 @@ namespace detail { template struct return_arg_pos_argument_must_be_positive -# if defined(__GNUC__) && __GNUC__ >= 3 || defined(__EDG__) +# if defined(__GNUC__) || defined(__EDG__) {} # endif ; diff --git a/include/boost/python/return_internal_reference.hpp b/include/boost/python/return_internal_reference.hpp index acb89e6d..cc60f442 100644 --- a/include/boost/python/return_internal_reference.hpp +++ b/include/boost/python/return_internal_reference.hpp @@ -18,7 +18,7 @@ namespace detail { template struct return_internal_reference_owner_arg_must_be_greater_than_zero -# if defined(__GNUC__) && __GNUC__ >= 3 || defined(__EDG__) +# if defined(__GNUC__) || defined(__EDG__) {} # endif ; diff --git a/include/boost/python/suite/indexing/indexing_suite.hpp b/include/boost/python/suite/indexing/indexing_suite.hpp index b636b211..40301fdf 100644 --- a/include/boost/python/suite/indexing/indexing_suite.hpp +++ b/include/boost/python/suite/indexing/indexing_suite.hpp @@ -131,11 +131,7 @@ namespace boost { namespace python { typedef detail::container_element container_element_t; -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - struct return_policy : return_internal_reference<> {}; -#else typedef return_internal_reference<> return_policy; -#endif typedef typename mpl::if_< no_proxy diff --git a/include/boost/python/to_python_converter.hpp b/include/boost/python/to_python_converter.hpp index 378d159e..4391b6dc 100644 --- a/include/boost/python/to_python_converter.hpp +++ b/include/boost/python/to_python_converter.hpp @@ -48,12 +48,7 @@ template < class T, class Conversion, bool has_get_pytype=false > struct to_python_converter { #ifndef BOOST_PYTHON_NO_PY_SIGNATURES -#if 0 //defined _MSC_VER && _MSC_VER >=1310 - //probably other compilers could come here as well - typedef typename detail::test_get_pytype HasGetPytype; -#else typedef boost::mpl::bool_ HasGetPytype; -#endif static PyTypeObject const* get_pytype_1(boost::mpl::true_ *) { diff --git a/include/boost/python/to_python_value.hpp b/include/boost/python/to_python_value.hpp index a48948d2..aaabb9cf 100644 --- a/include/boost/python/to_python_value.hpp +++ b/include/boost/python/to_python_value.hpp @@ -147,11 +147,6 @@ namespace detail template inline PyObject* registry_to_python_value::operator()(argument_type x) const { - typedef converter::registered r; -# if BOOST_WORKAROUND(__GNUC__, < 3) - // suppresses an ICE, somehow - (void)r::converters; -# endif return converter::registered::converters.to_python(&x); } diff --git a/include/boost/python/type_id.hpp b/include/boost/python/type_id.hpp index 4a5727d5..38b7f7b4 100644 --- a/include/boost/python/type_id.hpp +++ b/include/boost/python/type_id.hpp @@ -15,11 +15,9 @@ # include # include # include -# include # ifndef BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE # if defined(__GNUC__) \ - && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) \ && !defined(__EDG_VERSION__) # define BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE # endif @@ -30,7 +28,7 @@ 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__) \ || defined(_AIX) \ || ( defined(__sgi) && defined(__host_mips)) \ || (defined(__hpux) && defined(__HP_aCC)) \ @@ -69,21 +67,18 @@ struct type_info : private totally_ordered base_id_t m_base_type; }; -# ifdef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS -# define BOOST_PYTHON_EXPLICIT_TT_DEF(T) ::boost::type* -# else -# define BOOST_PYTHON_EXPLICIT_TT_DEF(T) -# endif + +// This macro is obsolete. Port away and remove. +# define BOOST_PYTHON_EXPLICIT_TT_DEF(T) template -inline type_info type_id(BOOST_EXPLICIT_TEMPLATE_TYPE(T)) +inline type_info type_id() { return type_info( # if !defined(_MSC_VER) \ - || (!BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \ - && !BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700)) + || !BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700) typeid(T) -# else // strip the decoration which msvc and Intel mistakenly leave in +# else // strip the decoration which Intel mistakenly leaves in python::detail::msvc_typeid((boost::type*)0) # endif ); @@ -99,7 +94,7 @@ inline type_info type_id(BOOST_EXPLICIT_TEMPLATE_TYPE(T)) # define BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID(T) \ template <> \ -inline type_info type_id(BOOST_PYTHON_EXPLICIT_TT_DEF(T)) \ +inline type_info type_id() \ { \ return type_info(typeid(T)); \ } @@ -171,22 +166,19 @@ inline char const* type_info::name() const BOOST_PYTHON_DECL std::ostream& operator<<(std::ostream&, type_info const&); -# if !BOOST_WORKAROUND(BOOST_MSVC, == 1200) template<> -inline type_info type_id(BOOST_PYTHON_EXPLICIT_TT_DEF(void)) +inline type_info type_id() { return type_info (typeid (void *)); } # ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS template<> -inline type_info type_id(BOOST_PYTHON_EXPLICIT_TT_DEF(const volatile void)) +inline type_info type_id() { return type_info (typeid (void *)); } # endif -# endif - }} // namespace boost::python #endif // TYPE_ID_DWA2002517_HPP diff --git a/include/boost/python/with_custodian_and_ward.hpp b/include/boost/python/with_custodian_and_ward.hpp index 9399478f..3431c6f2 100644 --- a/include/boost/python/with_custodian_and_ward.hpp +++ b/include/boost/python/with_custodian_and_ward.hpp @@ -85,14 +85,10 @@ struct with_custodian_and_ward_postcall : BasePolicy_ static PyObject* postcall(ArgumentPackage const& args_, PyObject* result) { std::size_t arity_ = detail::arity(args_); -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - if ( custodian > arity_ || ward > arity_ ) -#else // check if either custodian or ward exceeds the arity // (this weird formulation avoids "always false" warnings // for arity_ = 0) if ( (std::max)(custodian, ward) > arity_ ) -#endif { PyErr_SetString( PyExc_IndexError diff --git a/src/exec.cpp b/src/exec.cpp index 12cdabcd..fa2860e4 100644 --- a/src/exec.cpp +++ b/src/exec.cpp @@ -84,9 +84,8 @@ object BOOST_PYTHON_DECL exec_file(str filename, object global, object local) if (local.is_none()) local = global; // should be 'char const *' but older python versions don't use 'const' yet. char *f = python::extract(filename); - // Let python open the file to avoid potential binary incompatibilities. -#if PY_VERSION_HEX >= 0x03400000 +#if PY_VERSION_HEX >= 0x03040000 FILE *fs = _Py_fopen(f, "r"); #elif PY_VERSION_HEX >= 0x03000000 PyObject *fo = Py_BuildValue("s", f); @@ -98,13 +97,10 @@ object BOOST_PYTHON_DECL exec_file(str filename, object global, object local) python::handle<> file(pyfile); FILE *fs = PyFile_AsFile(file.get()); #endif - - int closeit = 1; // Close file before PyRun returns - PyObject* result = PyRun_FileEx(fs, + PyObject* result = PyRun_File(fs, f, Py_file_input, - global.ptr(), local.ptr(), - closeit); + global.ptr(), local.ptr()); if (!result) throw_error_already_set(); return object(detail::new_reference(result)); } diff --git a/test/const_argument.cpp b/test/const_argument.cpp index 6c5a8945..279c3dc1 100644 --- a/test/const_argument.cpp +++ b/test/const_argument.cpp @@ -9,10 +9,8 @@ * compiler's bug. */ #include -#include using namespace boost::python; -BOOST_TT_BROKEN_COMPILER_SPEC( object ) #if BOOST_WORKAROUND(BOOST_MSVC, == 1200) bool accept_const_arg( object );