diff --git a/example/timer/regex_timer.cpp b/example/timer/regex_timer.cpp index 5e92cf7f..5392665e 100644 --- a/example/timer/regex_timer.cpp +++ b/example/timer/regex_timer.cpp @@ -35,6 +35,7 @@ using std::getline; #include #include #include +#include #if (defined(_MSC_VER) && (_MSC_VER <= 1300)) || defined(__sgi) // maybe no Koenig lookup, use using declaration instead: @@ -145,7 +146,7 @@ int main(int argc, char**argv) double tim; bool result; int iters = 100; - double wait_time = std::min(t.elapsed_min() * 1000, 1.0); + double wait_time = boost::std_min(t.elapsed_min() * 1000, 1.0); while(true) { diff --git a/include/boost/regex/v3/regex_match.hpp b/include/boost/regex/v3/regex_match.hpp index 8fae9c9d..66db56e8 100644 --- a/include/boost/regex/v3/regex_match.hpp +++ b/include/boost/regex/v3/regex_match.hpp @@ -213,7 +213,7 @@ public: { difference_type dist = boost::re_detail::distance(a,b); states *= states; - difference_type lim = std::numeric_limits::max() - 1000 - states; + difference_type lim = (std::numeric_limits::max)() - 1000 - states; if(dist > (difference_type)(lim / states)) max_state_count = lim; else diff --git a/include/boost/regex/v4/perl_matcher_common.hpp b/include/boost/regex/v4/perl_matcher_common.hpp index a8c485d5..b8978ffa 100644 --- a/include/boost/regex/v4/perl_matcher_common.hpp +++ b/include/boost/regex/v4/perl_matcher_common.hpp @@ -78,7 +78,7 @@ void perl_matcher::estimate_max_sta difference_type dist = boost::re_detail::distance(base, last); traits_size_type states = static_cast(re.size()); states *= states; - difference_type lim = std::numeric_limits::max() - 1000 - states; + difference_type lim = (std::numeric_limits::max)() - 1000 - states; if(dist > (difference_type)(lim / states)) max_state_count = lim; else diff --git a/include/boost/regex/v4/perl_matcher_non_recursive.hpp b/include/boost/regex/v4/perl_matcher_non_recursive.hpp index 0f231a27..c29f3fe7 100644 --- a/include/boost/regex/v4/perl_matcher_non_recursive.hpp +++ b/include/boost/regex/v4/perl_matcher_non_recursive.hpp @@ -21,6 +21,7 @@ #define BOOST_REGEX_V4_PERL_MATCHER_NON_RECURSIVE_HPP #include +#include #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX @@ -546,7 +547,7 @@ bool perl_matcher::match_dot_repeat return match_dot_repeat_slow(); const re_repeat* rep = static_cast(pstate); - unsigned count = std::min(static_cast(re_detail::distance(position, last)), static_cast(rep->greedy ? rep->max : rep->min)); + unsigned count = std_min(static_cast(re_detail::distance(position, last)), static_cast(rep->greedy ? rep->max : rep->min)); if(rep->min > count) return false; // not enough text left to match std::advance(position, count); @@ -593,7 +594,7 @@ bool perl_matcher::match_char_repea if(::boost::is_random_access_iterator::value) { BidiIterator end = position; - std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired)); + std::advance(end, std_min((unsigned)re_detail::distance(position, last), desired)); BidiIterator origin(position); while((position != end) && (traits_inst.translate(*position, icase) == what)) { @@ -660,7 +661,7 @@ bool perl_matcher::match_set_repeat if(::boost::is_random_access_iterator::value) { BidiIterator end = position; - std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired)); + std::advance(end, std_min((unsigned)re_detail::distance(position, last), desired)); BidiIterator origin(position); while((position != end) && map[(traits_uchar_type)traits_inst.translate(*position, icase)]) { @@ -727,7 +728,7 @@ bool perl_matcher::match_long_set_r if(::boost::is_random_access_iterator::value) { BidiIterator end = position; - std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired)); + std::advance(end, std_min((unsigned)re_detail::distance(position, last), desired)); BidiIterator origin(position); while((position != end) && (position != re_is_set_member(position, last, set, re))) { diff --git a/include/boost/regex/v4/perl_matcher_recursive.hpp b/include/boost/regex/v4/perl_matcher_recursive.hpp index 89c78e27..78f856dd 100644 --- a/include/boost/regex/v4/perl_matcher_recursive.hpp +++ b/include/boost/regex/v4/perl_matcher_recursive.hpp @@ -20,6 +20,8 @@ #ifndef BOOST_REGEX_V4_PERL_MATCHER_RECURSIVE_HPP #define BOOST_REGEX_V4_PERL_MATCHER_RECURSIVE_HPP +#include + #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif @@ -400,7 +402,7 @@ bool perl_matcher::match_dot_repeat // start by working out how much we can skip: // const re_repeat* rep = static_cast(pstate); - unsigned count = std::min(static_cast(re_detail::distance(position, last)), (rep->greedy ? rep->max : rep->min)); + unsigned count = std_min(static_cast(re_detail::distance(position, last)), (rep->greedy ? rep->max : rep->min)); if(rep->min > count) return false; // not enough text left to match std::advance(position, count); @@ -458,7 +460,7 @@ bool perl_matcher::match_char_repea if(::boost::is_random_access_iterator::value) { BidiIterator end = position; - std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired)); + std::advance(end, std_min((unsigned)re_detail::distance(position, last), desired)); BidiIterator origin(position); while((position != end) && (traits_inst.translate(*position, icase) == what)) { @@ -538,7 +540,7 @@ bool perl_matcher::match_set_repeat if(::boost::is_random_access_iterator::value) { BidiIterator end = position; - std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired)); + std::advance(end, std_min((unsigned)re_detail::distance(position, last), desired)); BidiIterator origin(position); while((position != end) && map[(traits_uchar_type)traits_inst.translate(*position, icase)]) { @@ -618,7 +620,7 @@ bool perl_matcher::match_long_set_r if(::boost::is_random_access_iterator::value) { BidiIterator end = position; - std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired)); + std::advance(end, std_min((unsigned)re_detail::distance(position, last), desired)); BidiIterator origin(position); while((position != end) && (position != re_is_set_member(position, last, set, re))) { diff --git a/performance/regex_comparison.hpp b/performance/regex_comparison.hpp index 5e309ff4..4117a084 100644 --- a/performance/regex_comparison.hpp +++ b/performance/regex_comparison.hpp @@ -63,7 +63,7 @@ struct results safe_greta_time(-1), posix_time(-1), pcre_time(-1), - factor(std::numeric_limits::max()), + factor((std::numeric_limits::max)()), expression(ex), description(desc) {} diff --git a/performance/time_boost.cpp b/performance/time_boost.cpp index 52d27bab..b030c69a 100644 --- a/performance/time_boost.cpp +++ b/performance/time_boost.cpp @@ -9,6 +9,7 @@ * */ +#include #include "regex_comparison.hpp" #include #include @@ -45,7 +46,7 @@ double time_match(const std::string& re, const std::string& text, bool icase) boost::regex_match(text, what, e); } run = tim.elapsed(); - result = std::min(run, result); + result = std_min(run, result); } return result / iter; } @@ -86,7 +87,7 @@ double time_find_all(const std::string& re, const std::string& text, bool icase) boost::regex_grep(&dummy_grep_proc, text, e); } run = tim.elapsed(); - result = std::min(run, result); + result = std_min(run, result); } return result / iter; } diff --git a/performance/time_greta.cpp b/performance/time_greta.cpp index 7653c6ce..6f08c2d8 100644 --- a/performance/time_greta.cpp +++ b/performance/time_greta.cpp @@ -9,6 +9,7 @@ * */ +#include #include "regex_comparison.hpp" #if defined(BOOST_HAS_GRETA) #include @@ -48,7 +49,7 @@ double time_match(const std::string& re, const std::string& text, bool icase) e.match(text, what); } run = tim.elapsed(); - result = std::min(run, result); + result = std_min(run, result); } return result / iter; } @@ -94,7 +95,7 @@ double time_find_all(const std::string& re, const std::string& text, bool icase) } } run = tim.elapsed(); - result = std::min(run, result); + result = std_min(run, result); } return result / iter; } diff --git a/performance/time_localised_boost.cpp b/performance/time_localised_boost.cpp index fb748deb..56bff664 100644 --- a/performance/time_localised_boost.cpp +++ b/performance/time_localised_boost.cpp @@ -12,6 +12,7 @@ #include "regex_comparison.hpp" #include #include +#include namespace bl{ @@ -45,7 +46,7 @@ double time_match(const std::string& re, const std::string& text, bool icase) boost::regex_match(text, what, e); } run = tim.elapsed(); - result = std::min(run, result); + result = std_min(run, result); } return result / iter; } @@ -86,7 +87,7 @@ double time_find_all(const std::string& re, const std::string& text, bool icase) boost::regex_grep(&dummy_grep_proc, text, e); } run = tim.elapsed(); - result = std::min(run, result); + result = std_min(run, result); } return result / iter; } diff --git a/performance/time_pcre.cpp b/performance/time_pcre.cpp index 94ebbf81..95603412 100644 --- a/performance/time_pcre.cpp +++ b/performance/time_pcre.cpp @@ -11,6 +11,7 @@ #include #include +#include #include "regex_comparison.hpp" #ifdef BOOST_HAS_PCRE #include "pcre.h" @@ -69,7 +70,7 @@ double time_match(const std::string& re, const std::string& text, bool icase) erroffset = pcre_exec(ppcre, pe, text.c_str(), text.size(), 0, 0, what, sizeof(what)/sizeof(int)); } run = tim.elapsed(); - result = std::min(run, result); + result = std_min(run, result); } free(ppcre); free(pe); @@ -152,7 +153,7 @@ double time_find_all(const std::string& re, const std::string& text, bool icase) } } run = tim.elapsed(); - result = std::min(run, result); + result = std_min(run, result); } return result / iter; } diff --git a/performance/time_posix.cpp b/performance/time_posix.cpp index 6972ec8c..75504ba0 100644 --- a/performance/time_posix.cpp +++ b/performance/time_posix.cpp @@ -11,6 +11,7 @@ #include #include +#include #include "regex_comparison.hpp" #ifdef BOOST_HAS_POSIX #include @@ -50,7 +51,7 @@ double time_match(const std::string& re, const std::string& text, bool icase) regexec(&e, text.c_str(), e.re_nsub, what, 0); } run = tim.elapsed(); - result = std::min(run, result); + result = std_min(run, result); } regfree(&e); return result / iter; @@ -116,7 +117,7 @@ double time_find_all(const std::string& re, const std::string& text, bool icase) } } run = tim.elapsed(); - result = std::min(run, result); + result = std_min(run, result); } return result / iter; } diff --git a/performance/time_safe_greta.cpp b/performance/time_safe_greta.cpp index cbf856b8..64664cb3 100644 --- a/performance/time_safe_greta.cpp +++ b/performance/time_safe_greta.cpp @@ -14,6 +14,7 @@ #include #include +#include #include "regexpr2.h" namespace gs{ @@ -49,7 +50,7 @@ double time_match(const std::string& re, const std::string& text, bool icase) e.match(text, what); } run = tim.elapsed(); - result = std::min(run, result); + result = std_min(run, result); } return result / iter; } @@ -96,7 +97,7 @@ double time_find_all(const std::string& re, const std::string& text, bool icase) } } run = tim.elapsed(); - result = std::min(run, result); + result = std_min(run, result); } return result / iter; }