From e85438cba05c88d088a26572e88e3996b38d88ed Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Mon, 10 Dec 2012 00:40:28 -0600 Subject: Clean up gcc/g++ compiler warnings that have accumulated. --- Source/Core/VideoCommon/Src/VertexLoaderManager.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Source/Core/VideoCommon/Src/VertexLoaderManager.cpp') diff --git a/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp b/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp index 316941a639..4afa6e941b 100644 --- a/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp @@ -20,8 +20,8 @@ #include using stdext::hash_map; #else -#include -using __gnu_cxx::hash_map; +#include +using std::unordered_map; #endif #include #include @@ -44,20 +44,21 @@ namespace stdext { return uid.GetHash(); } } +typedef hash_map VertexLoaderMap; #else -namespace __gnu_cxx { +namespace std { template<> struct hash { size_t operator()(const VertexLoaderUID& uid) const { return uid.GetHash(); } }; } +typedef unordered_map VertexLoaderMap; #endif namespace VertexLoaderManager { -typedef hash_map VertexLoaderMap; static VertexLoaderMap g_VertexLoaderMap; // TODO - change into array of pointers. Keep a map of all seen so far. -- cgit v1.2.3 From f6df3d15134def6845dfe74fa7d38d1d6688e5a5 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Mon, 10 Dec 2012 08:40:27 -0600 Subject: OSX build fix for the unordered_map/hash_map issue. --- Source/Core/VideoCommon/Src/VertexLoaderManager.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'Source/Core/VideoCommon/Src/VertexLoaderManager.cpp') diff --git a/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp b/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp index 4afa6e941b..153e69a8c3 100644 --- a/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp @@ -19,6 +19,9 @@ #ifdef _MSC_VER #include using stdext::hash_map; +#elif defined __APPLE__ +#include +using __gnu_cxx::hash_map; #else #include using std::unordered_map; @@ -44,15 +47,24 @@ namespace stdext { return uid.GetHash(); } } -typedef hash_map VertexLoaderMap; #else -namespace std { +#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 -- cgit v1.2.3