aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/gtest/internal/gtest-port.h9
-rw-r--r--src/gtest-port.cc1
-rw-r--r--test/gtest-printers_test.cc10
3 files changed, 14 insertions, 6 deletions
diff --git a/include/gtest/internal/gtest-port.h b/include/gtest/internal/gtest-port.h
index 4e7e8551..864a90cb 100644
--- a/include/gtest/internal/gtest-port.h
+++ b/include/gtest/internal/gtest-port.h
@@ -606,6 +606,15 @@ struct _RTL_CRITICAL_SECTION;
# include <time.h> // NOLINT
#endif
+// Determines if hash_map/hash_set are available.
+// Only used for testing against those containers.
+#if !defined(GTEST_HAS_HASH_MAP_)
+# if _MSC_VER
+# define GTEST_HAS_HASH_MAP_ 1 // Indicates that hash_map is available.
+# define GTEST_HAS_HASH_SET_ 1 // Indicates that hash_set is available.
+# endif // _MSC_VER
+#endif // !defined(GTEST_HAS_HASH_MAP_)
+
// Determines whether Google Test can use tr1/tuple. You can define
// this macro to 0 to prevent Google Test from using tuple (any
// feature depending on tuple with be disabled in this mode).
diff --git a/src/gtest-port.cc b/src/gtest-port.cc
index 19fa0280..cd3ac9a5 100644
--- a/src/gtest-port.cc
+++ b/src/gtest-port.cc
@@ -887,7 +887,6 @@ GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(
return file_name + ":" + StreamableToString(line);
}
-
GTestLog::GTestLog(GTestLogSeverity severity, const char* file, int line)
: severity_(severity) {
const char* const marker =
diff --git a/test/gtest-printers_test.cc b/test/gtest-printers_test.cc
index a6636c57..3e97cc24 100644
--- a/test/gtest-printers_test.cc
+++ b/test/gtest-printers_test.cc
@@ -50,13 +50,13 @@
#include "gtest/gtest.h"
-// hash_map and hash_set are available under Visual C++.
-#if _MSC_VER
-# define GTEST_HAS_HASH_MAP_ 1 // Indicates that hash_map is available.
+// hash_map and hash_set are available under Visual C++, or on Linux.
+#if GTEST_HAS_HASH_MAP_
# include <hash_map> // NOLINT
-# define GTEST_HAS_HASH_SET_ 1 // Indicates that hash_set is available.
+#endif // GTEST_HAS_HASH_MAP_
+#if GTEST_HAS_HASH_SET_
# include <hash_set> // NOLINT
-#endif // GTEST_OS_WINDOWS
+#endif // GTEST_HAS_HASH_SET_
#if GTEST_HAS_STD_FORWARD_LIST_
# include <forward_list> // NOLINT