Chromium Code Reviews| Index: mojo/edk/system/channel_endpoint_id.h |
| diff --git a/mojo/edk/system/channel_endpoint_id.h b/mojo/edk/system/channel_endpoint_id.h |
| index c67325878c6fbe3c69f0b1b8a600216ff3309064..241871e46aa9e4f2c427dc0fe48a2b844ad4a426 100644 |
| --- a/mojo/edk/system/channel_endpoint_id.h |
| +++ b/mojo/edk/system/channel_endpoint_id.h |
| @@ -13,6 +13,7 @@ |
| #include "base/containers/hash_tables.h" |
| #include "base/gtest_prod_util.h" |
| #include "base/macros.h" |
| +#include "build/build_config.h" |
| #include "mojo/edk/system/system_impl_export.h" |
| namespace mojo { |
| @@ -132,9 +133,11 @@ class MOJO_SYSTEM_IMPL_EXPORT RemoteChannelEndpointIdGenerator { |
| // Define "hash" functions for |ChannelEndpointId|s, so they can be used in hash |
| // tables. |
| // TODO(vtl): Once we can use |std::unordered_{map,set}|, update this (and |
| -// remove the base/containers/hash_tables.h include). |
| +// remove the base/containers/hash_tables.h and build/build_config.h includes). |
| namespace BASE_HASH_NAMESPACE { |
| +#if defined(COMPILER_GCC) |
|
jamesr
2014/10/27 20:28:20
actually we don't need this any more, the hashing
Aaron Boodman
2014/10/28 22:38:47
Done.
|
| + |
| template <> |
| struct hash<mojo::system::ChannelEndpointId> { |
| size_t operator()(mojo::system::ChannelEndpointId channel_endpoint_id) const { |
| @@ -142,6 +145,13 @@ struct hash<mojo::system::ChannelEndpointId> { |
| } |
| }; |
| +#elif defined(COMPILER_MSVC) |
| + |
| +inline size_t hash_value(mojo::system::ChannelEndpointId channel_endpoint_id) { |
| + return static_cast<size_t>(channel_endpoint_id.value()); |
| +} |
| +#endif |
| + |
| } // namespace BASE_HASH_NAMESPACE |
| #endif // MOJO_EDK_SYSTEM_CHANNEL_ENDPOINT_ID_H_ |