mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
We can use unordered_map without pain now!
This commit is contained in:
@ -16,17 +16,7 @@
|
|||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#ifdef _MSC_VER
|
|
||||||
#include <hash_map>
|
|
||||||
using stdext::hash_map;
|
|
||||||
#elif defined __APPLE__
|
|
||||||
#include <ext/hash_map>
|
|
||||||
using __gnu_cxx::hash_map;
|
|
||||||
#else
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
using std::unordered_map;
|
|
||||||
#endif
|
|
||||||
#include <map>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "VideoCommon.h"
|
#include "VideoCommon.h"
|
||||||
@ -41,32 +31,21 @@ static int s_attr_dirty; // bitfield
|
|||||||
|
|
||||||
static VertexLoader *g_VertexLoaders[8];
|
static VertexLoader *g_VertexLoaders[8];
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
namespace std
|
||||||
namespace stdext {
|
{
|
||||||
inline size_t hash_value(const VertexLoaderUID& uid) {
|
|
||||||
|
template <>
|
||||||
|
struct hash<VertexLoaderUID>
|
||||||
|
{
|
||||||
|
size_t operator()(const VertexLoaderUID& uid) const
|
||||||
|
{
|
||||||
return uid.GetHash();
|
return uid.GetHash();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
#else
|
|
||||||
#ifdef __APPLE__
|
|
||||||
namespace __gnu_cxx
|
|
||||||
#else
|
|
||||||
namespace std
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
template<> struct hash<VertexLoaderUID> {
|
|
||||||
size_t operator()(const VertexLoaderUID& uid) const {
|
|
||||||
return uid.GetHash();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined _MSC_VER || defined __APPLE__
|
}
|
||||||
typedef hash_map<VertexLoaderUID, VertexLoader*> VertexLoaderMap;
|
|
||||||
#else
|
typedef std::unordered_map<VertexLoaderUID, VertexLoader*> VertexLoaderMap;
|
||||||
typedef unordered_map<VertexLoaderUID, VertexLoader*> VertexLoaderMap;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace VertexLoaderManager
|
namespace VertexLoaderManager
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user