Skip to content

Commit 42e7d7b

Browse files
committed
Python: Clean up some old MSVC related code.
[SVN r85922]
1 parent 5476f97 commit 42e7d7b

24 files changed

+18
-271
lines changed

include/boost/python/class.hpp

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ class class_ : public objects::class_base
302302
}
303303

304304
// Property creation
305-
# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
306305
template <class Get>
307306
self& add_property(char const* name, Get fget, char const* docstr = 0)
308307
{
@@ -317,47 +316,6 @@ class class_ : public objects::class_base
317316
name, this->make_getter(fget), this->make_setter(fset), docstr);
318317
return *this;
319318
}
320-
# else
321-
private:
322-
template <class Get>
323-
self& add_property_impl(char const* name, Get fget, char const* docstr, int)
324-
{
325-
base::add_property(name, this->make_getter(fget), docstr);
326-
return *this;
327-
}
328-
329-
template <class Get, class Set>
330-
self& add_property_impl(char const* name, Get fget, Set fset, ...)
331-
{
332-
base::add_property(
333-
name, this->make_getter(fget), this->make_setter(fset), 0);
334-
return *this;
335-
}
336-
337-
public:
338-
template <class Get>
339-
self& add_property(char const* name, Get fget)
340-
{
341-
base::add_property(name, this->make_getter(fget), 0);
342-
return *this;
343-
}
344-
345-
template <class Get, class DocStrOrSet>
346-
self& add_property(char const* name, Get fget, DocStrOrSet docstr_or_set)
347-
{
348-
this->add_property_impl(name, this->make_getter(fget), docstr_or_set, 0);
349-
return *this;
350-
}
351-
352-
template <class Get, class Set>
353-
self&
354-
add_property(char const* name, Get fget, Set fset, char const* docstr)
355-
{
356-
base::add_property(
357-
name, this->make_getter(fget), this->make_setter(fset), docstr);
358-
return *this;
359-
}
360-
# endif
361319

362320
template <class Get>
363321
self& add_static_property(char const* name, Get fget)

include/boost/python/converter/arg_from_python.hpp

100755100644
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ struct arg_rvalue_from_python
115115
arg_rvalue_from_python(PyObject*);
116116
bool convertible() const;
117117

118-
# if BOOST_MSVC < 1301 || _MSC_FULL_VER > 13102196
118+
# if _MSC_FULL_VER > 13102196
119119
typename arg_rvalue_from_python<T>::
120-
# endif
120+
# endif
121121
result_type operator()();
122122

123123
private:

include/boost/python/converter/arg_to_python_base.hpp

100755100644
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,9 @@ struct registration;
1313
namespace detail
1414
{
1515
struct BOOST_PYTHON_DECL arg_to_python_base
16-
# if !defined(BOOST_MSVC) || BOOST_MSVC <= 1300 || _MSC_FULL_VER > 13102179
1716
: handle<>
18-
# endif
1917
{
2018
arg_to_python_base(void const volatile* source, registration const&);
21-
# if defined(BOOST_MSVC) && BOOST_MSVC > 1300 && _MSC_FULL_VER <= 13102179
22-
PyObject* get() const { return m_ptr.get(); }
23-
PyObject* release() { return m_ptr.release(); }
24-
private:
25-
handle<> m_ptr;
26-
# endif
2719
};
2820
}
2921

include/boost/python/data_members.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ inline object make_getter(D& x)
270270
return detail::make_getter(x, policy, is_member_pointer<D>(), 0L);
271271
}
272272

273-
# if !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) && !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
273+
# if !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
274274
template <class D>
275275
inline object make_getter(D const& d)
276276
{
@@ -305,7 +305,7 @@ inline object make_setter(D& x)
305305
return detail::make_setter(x, default_call_policies(), is_member_pointer<D>(), 0);
306306
}
307307

308-
# if !(BOOST_WORKAROUND(BOOST_MSVC, <= 1300) || BOOST_WORKAROUND(__EDG_VERSION__, <= 238))
308+
# if BOOST_WORKAROUND(__EDG_VERSION__, <= 238))
309309
template <class D>
310310
inline object make_setter(D const& x)
311311
{

include/boost/python/detail/config.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@
2929
# endif
3030

3131
# if defined(BOOST_MSVC)
32-
# if _MSC_VER < 1300
33-
# define BOOST_MSVC6_OR_EARLIER 1
34-
# endif
3532

3633
# pragma warning (disable : 4786) // disable truncated debug symbols
3734
# pragma warning (disable : 4251) // disable exported dll function

include/boost/python/detail/construct.hpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,7 @@
88
namespace boost { namespace python { namespace detail {
99

1010
template <class T, class Arg>
11-
void construct_pointee(void* storage, Arg& x
12-
# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
13-
, T const volatile*
14-
# else
15-
, T const*
16-
# endif
17-
)
11+
void construct_pointee(void* storage, Arg& x, T const volatile*)
1812
{
1913
new (storage) T(x);
2014
}

include/boost/python/detail/destroy.hpp

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,12 @@
77

88
# include <boost/type_traits/is_array.hpp>
99
# include <boost/detail/workaround.hpp>
10-
# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
11-
# include <boost/type_traits/is_enum.hpp>
12-
# endif
1310
namespace boost { namespace python { namespace detail {
1411

15-
template <
16-
bool array
17-
# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
18-
, bool enum_ // vc7 has a problem destroying enums
19-
# endif
20-
> struct value_destroyer;
12+
template <bool array> struct value_destroyer;
2113

2214
template <>
23-
struct value_destroyer<
24-
false
25-
# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
26-
, false
27-
# endif
28-
>
15+
struct value_destroyer<false>
2916
{
3017
template <class T>
3118
static void execute(T const volatile* p)
@@ -35,12 +22,7 @@ struct value_destroyer<
3522
};
3623

3724
template <>
38-
struct value_destroyer<
39-
true
40-
# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
41-
, false
42-
# endif
43-
>
25+
struct value_destroyer<true>
4426
{
4527
template <class A, class T>
4628
static void execute(A*, T const volatile* const first)
@@ -49,9 +31,6 @@ struct value_destroyer<
4931
{
5032
value_destroyer<
5133
boost::is_array<T>::value
52-
# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
53-
, boost::is_enum<T>::value
54-
# endif
5534
>::execute(p);
5635
}
5736
}
@@ -63,35 +42,13 @@ struct value_destroyer<
6342
}
6443
};
6544

66-
# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
67-
template <>
68-
struct value_destroyer<true,true>
69-
{
70-
template <class T>
71-
static void execute(T const volatile*)
72-
{
73-
}
74-
};
75-
76-
template <>
77-
struct value_destroyer<false,true>
78-
{
79-
template <class T>
80-
static void execute(T const volatile*)
81-
{
82-
}
83-
};
84-
# endif
8545
template <class T>
8646
inline void destroy_referent_impl(void* p, T& (*)())
8747
{
8848
// note: cv-qualification needed for MSVC6
8949
// must come *before* T for metrowerks
9050
value_destroyer<
9151
(boost::is_array<T>::value)
92-
# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
93-
, (boost::is_enum<T>::value)
94-
# endif
9552
>::execute((const volatile T*)p);
9653
}
9754

include/boost/python/detail/enable_if.hpp

100755100644
Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,7 @@
77
# include <boost/python/detail/sfinae.hpp>
88
# include <boost/detail/workaround.hpp>
99

10-
# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
11-
# include <boost/mpl/if.hpp>
12-
13-
namespace boost { namespace python { namespace detail {
14-
15-
template <class T> struct always_void { typedef void type; };
16-
17-
template <class C, class T = int>
18-
struct enable_if_arg
19-
{
20-
typedef typename mpl::if_<C,T,int&>::type type;
21-
};
22-
23-
template <class C, class T = int>
24-
struct disable_if_arg
25-
{
26-
typedef typename mpl::if_<C,int&,T>::type type;
27-
};
28-
29-
template <class C, class T = typename always_void<C>::type>
30-
struct enable_if_ret
31-
{
32-
typedef typename mpl::if_<C,T,int[2]>::type type;
33-
};
34-
35-
template <class C, class T = typename always_void<C>::type>
36-
struct disable_if_ret
37-
{
38-
typedef typename mpl::if_<C,int[2],T>::type type;
39-
};
40-
41-
}}} // namespace boost::python::detail
42-
43-
# elif !defined(BOOST_NO_SFINAE)
10+
#if !defined(BOOST_NO_SFINAE)
4411
# include <boost/utility/enable_if.hpp>
4512

4613
namespace boost { namespace python { namespace detail {

include/boost/python/detail/force_instantiate.hpp

100755100644
Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,9 @@ namespace boost { namespace python { namespace detail {
1010
// Allows us to force the argument to be instantiated without
1111
// incurring unused variable warnings
1212

13-
# if !defined(BOOST_MSVC) || BOOST_MSVC < 1300 || _MSC_FULL_VER > 13102196
14-
1513
template <class T>
1614
inline void force_instantiate(T const&) {}
1715

18-
# else
19-
20-
# pragma optimize("g", off)
21-
inline void force_instantiate_impl(...) {}
22-
# pragma optimize("", on)
23-
template <class T>
24-
inline void force_instantiate(T const& x)
25-
{
26-
detail::force_instantiate_impl(&x);
27-
}
28-
# endif
29-
3016
}}} // namespace boost::python::detail
3117

3218
#endif // FORCE_INSTANTIATE_DWA200265_HPP

include/boost/python/detail/if_else.hpp

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -25,46 +25,11 @@ struct if_selected
2525
};
2626
};
2727

28-
# if defined(BOOST_MSVC) && (BOOST_MSVC == 1300)
29-
namespace msvc70_aux {
30-
31-
template< bool > struct inherit_from
32-
{
33-
template< typename T > struct result
34-
{
35-
typedef T type;
36-
};
37-
};
38-
39-
template<> struct inherit_from<true>
40-
{
41-
template< typename T > struct result
42-
{
43-
struct type {};
44-
};
45-
};
46-
47-
template< typename T >
48-
struct never_true
49-
{
50-
BOOST_STATIC_CONSTANT(bool, value = false);
51-
};
52-
53-
} // namespace msvc70_aux
54-
55-
#endif // # if defined(BOOST_MSVC) && (BOOST_MSVC == 1300)
56-
5728
template <class T>
5829
struct elif_selected
5930
{
60-
# if !(defined(BOOST_MSVC) && BOOST_MSVC <= 1300 || defined(__MWERKS__) && __MWERKS__ <= 0x2407)
31+
# if !(defined(__MWERKS__) && __MWERKS__ <= 0x2407)
6132
template <class U> class then;
62-
# elif defined(BOOST_MSVC) && (BOOST_MSVC == 1300)
63-
template <class U>
64-
struct then : msvc70_aux::inherit_from< msvc70_aux::never_true<U>::value >
65-
::template result< if_selected<T> >::type
66-
{
67-
};
6833
# else
6934
template <class U>
7035
struct then : if_selected<T>
@@ -73,7 +38,7 @@ struct elif_selected
7338
# endif
7439
};
7540

76-
# if !(defined(BOOST_MSVC) && BOOST_MSVC <= 1300 || defined(__MWERKS__) && __MWERKS__ <= 0x2407)
41+
# if !(defined(__MWERKS__) && __MWERKS__ <= 0x2407)
7742
template <class T>
7843
template <class U>
7944
class elif_selected<T>::then : public if_selected<T>

0 commit comments

Comments
 (0)