2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-24 18:12:43 +00:00

remove minmax hack from win32.hpp and fix all places that could be affected by the minmax macros

[SVN r22394]
This commit is contained in:
Eric Niebler
2004-02-26 18:27:02 +00:00
parent a9c2a95366
commit 115f9f0644
5 changed files with 9 additions and 7 deletions

View File

@@ -87,7 +87,7 @@ namespace detail
BOOST_PYTHON_TO_PYTHON_BY_VALUE( \
unsigned T \
, static_cast<unsigned long>(x) > static_cast<unsigned long>( \
std::numeric_limits<long>::max()) \
(std::numeric_limits<long>::max)()) \
? ::PyLong_FromUnsignedLong(x) \
: ::PyInt_FromLong(x))

View File

@@ -52,7 +52,7 @@ object raw_function(F f, std::size_t min_args = 0)
detail::raw_dispatcher<F>(f)
, mpl::vector1<PyObject*>()
, min_args
, std::numeric_limits<unsigned>::max()
, (std::numeric_limits<unsigned>::max)()
)
);
}

View File

@@ -9,6 +9,7 @@
#include <boost/python/object.hpp>
#include <boost/python/extract.hpp>
#include <boost/python/converter/pytype_object_mgr_traits.hpp>
#include <boost/minmax.hpp>
#include <iterator>
#include <algorithm>
@@ -138,7 +139,7 @@ class slice : public object
throw std::invalid_argument( "Zero-length slice");
if (i >= 0) {
ret.start = begin;
std::advance( ret.start, std::min(i, max_dist-1));
std::advance( ret.start, std_min(i, max_dist-1));
}
else {
if (i < -max_dist && ret.step < 0)
@@ -182,7 +183,7 @@ class slice : public object
if (i > 0) {
ret.stop = begin;
std::advance( ret.stop, std::min( i-1, max_dist-1));
std::advance( ret.stop, std_min( i-1, max_dist-1));
}
else { // i is negative, but not more negative than -max_dist
ret.stop = end;

View File

@@ -21,6 +21,7 @@
#include <boost/python/self.hpp>
#include <boost/python/dict.hpp>
#include <boost/python/str.hpp>
#include <boost/minmax.hpp>
#include <functional>
#include <vector>
#include <cstddef>
@@ -481,7 +482,7 @@ namespace objects
// Build a tuple of the base Python type objects. If no bases
// were declared, we'll use our class_type() as the single base
// class.
std::size_t const num_bases = std::max(num_types - 1, static_cast<std::size_t>(1));
std::size_t const num_bases = std_max(num_types - 1, static_cast<std::size_t>(1));
handle<> bases(PyTuple_New(num_bases));
for (std::size_t i = 1; i <= num_bases; ++i)

View File

@@ -91,7 +91,7 @@ namespace
if (m_distances.size() != n * n)
{
m_distances.clear();
m_distances.resize(n * n, std::numeric_limits<std::size_t>::max());
m_distances.resize(n * n, (std::numeric_limits<std::size_t>::max)());
m_known_vertices = n;
}
@@ -293,7 +293,7 @@ namespace
smart_graph::node_distance_map d(g.distances_to(dst));
if (d[src] == std::numeric_limits<std::size_t>::max())
if (d[src] == (std::numeric_limits<std::size_t>::max)())
return 0;
typedef property_map<cast_graph,edge_cast_t>::const_type cast_map;