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:
@@ -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))
|
||||
|
||||
|
||||
@@ -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)()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user