From 6e9f9132b459ff35b9e1520c5492408e4b925fe7 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 19 Jul 2005 17:14:00 +0000 Subject: [PATCH] Added fix for gcc versions that have only partial long long support. [SVN r30181] --- test/limits_test.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/limits_test.cpp b/test/limits_test.cpp index 25c776e0..163c684e 100644 --- a/test/limits_test.cpp +++ b/test/limits_test.cpp @@ -54,6 +54,24 @@ inline int make_char_numeric_for_streaming(signed char c) { return c; } inline int make_char_numeric_for_streaming(unsigned char c) { return c; } #endif +#if (defined(_GLIBCPP_VERSION) || defined(_GLIBCXX_VERSION)) \ + && defined(BOOST_HAS_LONG_LONG) \ + && !defined(_GLIBCPP_USE_LONG_LONG) \ + && !defined(_GLIBCXX_USE_LONG_LONG) +// +// Some libstdc++ versions have numeric_limits but no +// iostream support for long long. TODO, find a better fix!! +// +std::ostream& operator<<(std::ostream& os, long long i ) +{ + return os << static_cast(i); +} +std::ostream& operator<<(std::ostream& os, unsigned long long i ) +{ + return os << static_cast(i); +} +#endif + template void test_integral_limits(const T &, const char * msg) {