Skip to content

Commit 115f9f0

Browse files
author
Eric Niebler
committed
remove minmax hack from win32.hpp and fix all places that could be affected by the minmax macros
[SVN r22394]
1 parent a9c2a95 commit 115f9f0

5 files changed

Lines changed: 9 additions & 7 deletions

File tree

include/boost/python/converter/builtin_converters.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ namespace detail
8787
BOOST_PYTHON_TO_PYTHON_BY_VALUE( \
8888
unsigned T \
8989
, static_cast<unsigned long>(x) > static_cast<unsigned long>( \
90-
std::numeric_limits<long>::max()) \
90+
(std::numeric_limits<long>::max)()) \
9191
? ::PyLong_FromUnsignedLong(x) \
9292
: ::PyInt_FromLong(x))
9393

include/boost/python/raw_function.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ object raw_function(F f, std::size_t min_args = 0)
5252
detail::raw_dispatcher<F>(f)
5353
, mpl::vector1<PyObject*>()
5454
, min_args
55-
, std::numeric_limits<unsigned>::max()
55+
, (std::numeric_limits<unsigned>::max)()
5656
)
5757
);
5858
}

include/boost/python/slice.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <boost/python/object.hpp>
1010
#include <boost/python/extract.hpp>
1111
#include <boost/python/converter/pytype_object_mgr_traits.hpp>
12+
#include <boost/minmax.hpp>
1213

1314
#include <iterator>
1415
#include <algorithm>
@@ -138,7 +139,7 @@ class slice : public object
138139
throw std::invalid_argument( "Zero-length slice");
139140
if (i >= 0) {
140141
ret.start = begin;
141-
std::advance( ret.start, std::min(i, max_dist-1));
142+
std::advance( ret.start, std_min(i, max_dist-1));
142143
}
143144
else {
144145
if (i < -max_dist && ret.step < 0)
@@ -182,7 +183,7 @@ class slice : public object
182183

183184
if (i > 0) {
184185
ret.stop = begin;
185-
std::advance( ret.stop, std::min( i-1, max_dist-1));
186+
std::advance( ret.stop, std_min( i-1, max_dist-1));
186187
}
187188
else { // i is negative, but not more negative than -max_dist
188189
ret.stop = end;

src/object/class.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <boost/python/self.hpp>
2222
#include <boost/python/dict.hpp>
2323
#include <boost/python/str.hpp>
24+
#include <boost/minmax.hpp>
2425
#include <functional>
2526
#include <vector>
2627
#include <cstddef>
@@ -481,7 +482,7 @@ namespace objects
481482
// Build a tuple of the base Python type objects. If no bases
482483
// were declared, we'll use our class_type() as the single base
483484
// class.
484-
std::size_t const num_bases = std::max(num_types - 1, static_cast<std::size_t>(1));
485+
std::size_t const num_bases = std_max(num_types - 1, static_cast<std::size_t>(1));
485486
handle<> bases(PyTuple_New(num_bases));
486487

487488
for (std::size_t i = 1; i <= num_bases; ++i)

src/object/inheritance.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ namespace
9191
if (m_distances.size() != n * n)
9292
{
9393
m_distances.clear();
94-
m_distances.resize(n * n, std::numeric_limits<std::size_t>::max());
94+
m_distances.resize(n * n, (std::numeric_limits<std::size_t>::max)());
9595
m_known_vertices = n;
9696
}
9797

@@ -293,7 +293,7 @@ namespace
293293

294294
smart_graph::node_distance_map d(g.distances_to(dst));
295295

296-
if (d[src] == std::numeric_limits<std::size_t>::max())
296+
if (d[src] == (std::numeric_limits<std::size_t>::max)())
297297
return 0;
298298

299299
typedef property_map<cast_graph,edge_cast_t>::const_type cast_map;

0 commit comments

Comments
 (0)