From 115f9f0644c11e978d7119e96c1bebb6e4a91c54 Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Thu, 26 Feb 2004 18:27:02 +0000 Subject: [PATCH] remove minmax hack from win32.hpp and fix all places that could be affected by the minmax macros [SVN r22394] --- include/boost/python/converter/builtin_converters.hpp | 2 +- include/boost/python/raw_function.hpp | 2 +- include/boost/python/slice.hpp | 5 +++-- src/object/class.cpp | 3 ++- src/object/inheritance.cpp | 4 ++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/boost/python/converter/builtin_converters.hpp b/include/boost/python/converter/builtin_converters.hpp index a53a0f5d..5580566f 100644 --- a/include/boost/python/converter/builtin_converters.hpp +++ b/include/boost/python/converter/builtin_converters.hpp @@ -87,7 +87,7 @@ namespace detail BOOST_PYTHON_TO_PYTHON_BY_VALUE( \ unsigned T \ , static_cast(x) > static_cast( \ - std::numeric_limits::max()) \ + (std::numeric_limits::max)()) \ ? ::PyLong_FromUnsignedLong(x) \ : ::PyInt_FromLong(x)) diff --git a/include/boost/python/raw_function.hpp b/include/boost/python/raw_function.hpp index 1ed3c3c1..176c42e3 100755 --- a/include/boost/python/raw_function.hpp +++ b/include/boost/python/raw_function.hpp @@ -52,7 +52,7 @@ object raw_function(F f, std::size_t min_args = 0) detail::raw_dispatcher(f) , mpl::vector1() , min_args - , std::numeric_limits::max() + , (std::numeric_limits::max)() ) ); } diff --git a/include/boost/python/slice.hpp b/include/boost/python/slice.hpp index 0bfdd161..99d8d8b0 100644 --- a/include/boost/python/slice.hpp +++ b/include/boost/python/slice.hpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -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; diff --git a/src/object/class.cpp b/src/object/class.cpp index 97bd7bbe..0cc1d59e 100644 --- a/src/object/class.cpp +++ b/src/object/class.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -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(1)); + std::size_t const num_bases = std_max(num_types - 1, static_cast(1)); handle<> bases(PyTuple_New(num_bases)); for (std::size_t i = 1; i <= num_bases; ++i) diff --git a/src/object/inheritance.cpp b/src/object/inheritance.cpp index 1eb05db5..50699726 100644 --- a/src/object/inheritance.cpp +++ b/src/object/inheritance.cpp @@ -91,7 +91,7 @@ namespace if (m_distances.size() != n * n) { m_distances.clear(); - m_distances.resize(n * n, std::numeric_limits::max()); + m_distances.resize(n * n, (std::numeric_limits::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::max()) + if (d[src] == (std::numeric_limits::max)()) return 0; typedef property_map::const_type cast_map;