Index: tools/gn/output_file.h |
diff --git a/tools/gn/output_file.h b/tools/gn/output_file.h |
index 2e7a0ce1d76bfb6925b22396ce7a6fe791535336..252fae4492f5247e7b59e1b6f4ecf56a9bbfa8c5 100644 |
--- a/tools/gn/output_file.h |
+++ b/tools/gn/output_file.h |
@@ -7,6 +7,7 @@ |
#include <string> |
+#include "base/containers/hash_tables.h" |
#include "tools/gn/build_settings.h" |
#include "tools/gn/source_file.h" |
@@ -41,4 +42,25 @@ class OutputFile { |
std::string value_; |
}; |
+namespace BASE_HASH_NAMESPACE { |
+ |
+#if defined(COMPILER_GCC) |
+template<> struct hash<OutputFile> { |
+ std::size_t operator()(const OutputFile& v) const { |
+ hash<std::string> h; |
+ return h(v.value()); |
+ } |
+}; |
+#elif defined(COMPILER_MSVC) |
+inline size_t hash_value(const OutputFile& v) { |
+ return hash_value(v.value()); |
+} |
+#endif // COMPILER... |
+ |
+} // namespace BASE_HASH_NAMESPACE |
+ |
+inline void swap(OutputFile& lhs, OutputFile& rhs) { |
+ lhs.value().swap(rhs.value()); |
+} |
+ |
#endif // TOOLS_GN_OUTPUT_FILE_H_ |