2
0
mirror of https://github.com/boostorg/python.git synced 2026-02-01 20:52:13 +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;