From 4ba12be6692a0afa92a506c08fa750257b9d51c2 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Mon, 1 Apr 2013 19:24:27 -0500 Subject: [PATCH] We can use unordered_map without pain now! --- .../VideoCommon/Src/VertexLoaderManager.cpp | 45 +++++-------------- 1 file changed, 12 insertions(+), 33 deletions(-) diff --git a/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp b/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp index 153e69a8c3..01db9f647c 100644 --- a/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp @@ -16,17 +16,7 @@ // http://code.google.com/p/dolphin-emu/ #include -#ifdef _MSC_VER -#include -using stdext::hash_map; -#elif defined __APPLE__ -#include -using __gnu_cxx::hash_map; -#else #include -using std::unordered_map; -#endif -#include #include #include "VideoCommon.h" @@ -41,32 +31,21 @@ static int s_attr_dirty; // bitfield static VertexLoader *g_VertexLoaders[8]; -#ifdef _MSC_VER -namespace stdext { - inline size_t hash_value(const VertexLoaderUID& uid) { +namespace std +{ + +template <> +struct hash +{ + size_t operator()(const VertexLoaderUID& uid) const + { return uid.GetHash(); } -} -#else -#ifdef __APPLE__ -namespace __gnu_cxx -#else -namespace std -#endif -{ - template<> struct hash { - size_t operator()(const VertexLoaderUID& uid) const { - return uid.GetHash(); - } - }; -} -#endif +}; -#if defined _MSC_VER || defined __APPLE__ -typedef hash_map VertexLoaderMap; -#else -typedef unordered_map VertexLoaderMap; -#endif +} + +typedef std::unordered_map VertexLoaderMap; namespace VertexLoaderManager {