summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
Diffstat (limited to 'base')
-rw-r--r--base/file_path.cc2
-rw-r--r--base/file_path.h15
2 files changed, 11 insertions, 6 deletions
diff --git a/base/file_path.cc b/base/file_path.cc
index 45f6e327..9a645b0 100644
--- a/base/file_path.cc
+++ b/base/file_path.cc
@@ -74,7 +74,7 @@ bool FilePath::IsSeparator(CharType character) {
}
// libgen's dirname and basename aren't guaranteed to be thread-safe and aren't
-// guaranteed to not modify their input strings, and in fact are implmeneted
+// guaranteed to not modify their input strings, and in fact are implemented
// differently in this regard on different platforms. Don't use them, but
// adhere to their behavior.
FilePath FilePath::DirName() const {
diff --git a/base/file_path.h b/base/file_path.h
index cadf2cf..7beb40e 100644
--- a/base/file_path.h
+++ b/base/file_path.h
@@ -69,10 +69,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
-
-#if defined(COMPILER_GCC)
#include "base/hash_tables.h"
-#endif
// Windows-style drive letter support and pathname separator characters can be
// enabled and disabled independently, to aid testing. These #defines are
@@ -204,8 +201,8 @@ class FilePath {
#define FILE_PATH_LITERAL(x) L ## x
#endif // OS_WIN
-#if defined(COMPILER_GCC)
// Implement hash function so that we can use FilePaths in hashsets and maps.
+#if defined(COMPILER_GCC)
namespace __gnu_cxx {
template<>
@@ -216,6 +213,14 @@ struct hash<FilePath> {
};
} // namespace __gnu_cxx
-#endif // defined(COMPILER_GCC)
+#elif defined(COMPILER_MSVC)
+namespace stdext {
+
+inline size_t hash_value(const FilePath& f) {
+ return hash_value(f.value());
+}
+
+} // namespace stdext
+#endif // COMPILER
#endif // BASE_FILE_PATH_H_