From a719320a3ce448dad588f0d5506e47fe84fa9d16 Mon Sep 17 00:00:00 2001 From: Gennadiy Civil Date: Tue, 13 Mar 2018 11:53:27 -0400 Subject: [PATCH] fixing, was removing too much --- googletest/test/gtest-printers_test.cc | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/googletest/test/gtest-printers_test.cc b/googletest/test/gtest-printers_test.cc index 686e62a8..1584de43 100644 --- a/googletest/test/gtest-printers_test.cc +++ b/googletest/test/gtest-printers_test.cc @@ -50,6 +50,15 @@ #include "gtest/gtest.h" +// hash_set are available under Visual C++, or on Linux. +#if GTEST_HAS_HASH_MAP_ +# include // NOLINT +#endif // GTEST_HAS_HASH_MAP_ + +#if GTEST_HAS_HASH_SET_ +# include // NOLINT +#endif // GTEST_HAS_HASH_SET_ + #if GTEST_HAS_STD_FORWARD_LIST_ # include // NOLINT #endif // GTEST_HAS_STD_FORWARD_LIST_ @@ -227,6 +236,34 @@ using ::testing::internal::UniversalTersePrint; using ::testing::internal::UniversalTersePrintTupleFieldsToStrings; #endif + +// The hash_* classes are not part of the C++ standard. STLport +// defines them in namespace std. MSVC defines them in ::stdext. GCC +// defines them in ::. +#if GTEST_HAS_HASH_MAP_ + +#ifdef _STLP_HASH_MAP // We got from STLport. +using ::std::hash_map; +using ::std::hash_multimap; +#elif _MSC_VER +using ::stdext::hash_map; +using ::stdext::hash_multimap; +#endif + +#endif + +#if GTEST_HAS_HASH_SET_ + +#ifdef _STLP_HASH_MAP // We got from STLport. +using ::std::hash_map; +using ::std::hash_multimap; +#elif _MSC_VER +using ::stdext::hash_map; +using ::stdext::hash_multimap; +#endif + +#endif + // Prints a value to a string using the universal value printer. This // is a helper for testing UniversalPrinter::Print() for various types. template