From e5a7bf697b418b66a92508089d16f6fc54d7fd94 Mon Sep 17 00:00:00 2001 From: lloyd Date: Fri, 12 Nov 2010 00:35:26 +0000 Subject: Thomas Keller reports that Mac OS X 10.5 still uses gcc 4.0.1 and it has the same reverse iterator bug. Use the workaround for gcc 4.0.* --- checks/bench.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'checks/bench.cpp') diff --git a/checks/bench.cpp b/checks/bench.cpp index d4531d181..1bc974635 100644 --- a/checks/bench.cpp +++ b/checks/bench.cpp @@ -146,6 +146,18 @@ void report_results(const std::string& algo, std::cout << algo; +#if defined(__SUNPRO_CC) + #define REVERSE_ITERATOR_BUG 1 +#elif defined(__GNUC__) && __GNUC__ <= 3 + #define REVERSE_ITERATOR_BUG 1 +#elif defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 0) + #define REVERSE_ITERATOR_BUG 1 +#endif + +#ifndef REVERSE_ITERATOR_BUG + #define REVERSE_ITERATOR_BUG 0 +#endif + #if (defined(__GNUC__) && __GNUC__ <= 3) || defined(__SUNPRO_CC) // Work around GCC 3.x bug, reverse iterators don't work for(std::map::const_iterator i = results.begin(); i != results.end(); ++i) -- cgit v1.2.3