Use unordered_map instead of hash_map on GCC

stdext namespace is a non-standard extension. Use standard std::unordered_map on GCC. Issue=358 Signed-of-by: Daniel Koch git-svn-id: https://angleproject.googlecode.com/svn/trunk@1260 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 1825d8e5
......@@ -11,7 +11,12 @@
#define LIBEGL_SHADER_CACHE_H_
#include <d3d9.h>
#ifdef _MSC_VER
#include <hash_map>
#else
#include <unordered_map>
#endif
namespace egl
{
......@@ -89,7 +94,15 @@ class ShaderCache
return mDevice->CreatePixelShader(function, shader);
}
typedef stdext::hash_map<std::string, ShaderObject*> Map;
#ifndef HASH_MAP
# ifdef _MSC_VER
# define HASH_MAP stdext::hash_map
# else
# define HASH_MAP std::unordered_map
# endif
#endif
typedef HASH_MAP<std::string, ShaderObject*> Map;
Map mMap;
IDirect3DDevice9 *mDevice;
......
......@@ -17,8 +17,13 @@
#include <EGL/egl.h>
#include <d3d9.h>
#include <string>
#include <map>
#ifdef _MSC_VER
#include <hash_map>
#else
#include <unordered_map>
#endif
#include "common/angleutils.h"
#include "common/RefCountObject.h"
......@@ -548,15 +553,23 @@ class Context
BindingPointer<Texture2D> mTexture2DZero;
BindingPointer<TextureCubeMap> mTextureCubeMapZero;
typedef stdext::hash_map<GLuint, Framebuffer*> FramebufferMap;
#ifndef HASH_MAP
# ifdef _MSC_VER
# define HASH_MAP stdext::hash_map
# else
# define HASH_MAP std::unordered_map
# endif
#endif
typedef HASH_MAP<GLuint, Framebuffer*> FramebufferMap;
FramebufferMap mFramebufferMap;
HandleAllocator mFramebufferHandleAllocator;
typedef stdext::hash_map<GLuint, Fence*> FenceMap;
typedef HASH_MAP<GLuint, Fence*> FenceMap;
FenceMap mFenceMap;
HandleAllocator mFenceHandleAllocator;
typedef stdext::hash_map<GLuint, Query*> QueryMap;
typedef HASH_MAP<GLuint, Query*> QueryMap;
QueryMap mQueryMap;
HandleAllocator mQueryHandleAllocator;
......
......@@ -13,7 +13,11 @@
#define GL_APICALL
#include <GLES2/gl2.h>
#ifdef _MSC_VER
#include <hash_map>
#else
#include <unordered_map>
#endif
#include "common/angleutils.h"
#include "libGLESv2/HandleAllocator.h"
......@@ -79,22 +83,30 @@ class ResourceManager
std::size_t mRefCount;
typedef stdext::hash_map<GLuint, Buffer*> BufferMap;
#ifndef HASH_MAP
# ifdef _MSC_VER
# define HASH_MAP stdext::hash_map
# else
# define HASH_MAP std::unordered_map
# endif
#endif
typedef HASH_MAP<GLuint, Buffer*> BufferMap;
BufferMap mBufferMap;
HandleAllocator mBufferHandleAllocator;
typedef stdext::hash_map<GLuint, Shader*> ShaderMap;
typedef HASH_MAP<GLuint, Shader*> ShaderMap;
ShaderMap mShaderMap;
typedef stdext::hash_map<GLuint, Program*> ProgramMap;
typedef HASH_MAP<GLuint, Program*> ProgramMap;
ProgramMap mProgramMap;
HandleAllocator mProgramShaderHandleAllocator;
typedef stdext::hash_map<GLuint, Texture*> TextureMap;
typedef HASH_MAP<GLuint, Texture*> TextureMap;
TextureMap mTextureMap;
HandleAllocator mTextureHandleAllocator;
typedef stdext::hash_map<GLuint, Renderbuffer*> RenderbufferMap;
typedef HASH_MAP<GLuint, Renderbuffer*> RenderbufferMap;
RenderbufferMap mRenderbufferMap;
HandleAllocator mRenderbufferHandleAllocator;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment