Fixed mingw compilation.
Change-Id: I8ae33c752feb19e291e4a3b128d21a0ced883c90
Reviewed-on: https://chromium-review.googlesource.com/220761
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Shannon Woods <shannonwoods@chromium.org>
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 77ff0ea..40a56a1 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -81,6 +81,7 @@
Ulrik Persson (ddefrostt)
Mark Banner (standard8mbp)
David Kilzer
+Jacek Caban
Microsoft Open Technologies, Inc.
Cooper Partin
diff --git a/src/common/debug.h b/src/common/debug.h
index bf2bca8..66c4c69 100644
--- a/src/common/debug.h
+++ b/src/common/debug.h
@@ -128,7 +128,7 @@
#endif
// A macro functioning as a compile-time assert to validate constant conditions
-#if defined(_MSC_VER) && _MSC_VER >= 1600
+#if (defined(_MSC_VER) && _MSC_VER >= 1600) || (defined(__GNUC__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 3))
#define META_ASSERT_MSG(condition, msg) static_assert(condition, msg)
#else
#define META_ASSERT_CONCAT(a, b) a ## b
diff --git a/src/libEGL/Display.cpp b/src/libEGL/Display.cpp
index ef8b3f0..863e52e 100644
--- a/src/libEGL/Display.cpp
+++ b/src/libEGL/Display.cpp
@@ -14,6 +14,7 @@
#include <map>
#include <vector>
#include <sstream>
+#include <iterator>
#include "common/debug.h"
#include "common/mathutil.h"
diff --git a/src/libGLESv2.gypi b/src/libGLESv2.gypi
index 7055e89..563b183 100644
--- a/src/libGLESv2.gypi
+++ b/src/libGLESv2.gypi
@@ -48,6 +48,7 @@
'libGLESv2/Buffer.h',
'libGLESv2/Caps.cpp',
'libGLESv2/Caps.h',
+ 'libGLESv2/Constants.h',
'libGLESv2/Context.cpp',
'libGLESv2/Context.h',
'libGLESv2/Error.cpp',
@@ -91,7 +92,6 @@
'libGLESv2/VertexAttribute.h',
'libGLESv2/angletypes.cpp',
'libGLESv2/angletypes.h',
- 'libGLESv2/constants.h',
'libGLESv2/formatutils.cpp',
'libGLESv2/formatutils.h',
'libGLESv2/main.cpp',
diff --git a/src/libGLESv2/constants.h b/src/libGLESv2/Constants.h
similarity index 100%
rename from src/libGLESv2/constants.h
rename to src/libGLESv2/Constants.h
diff --git a/src/libGLESv2/Context.cpp b/src/libGLESv2/Context.cpp
index 5a5e3a0..ba63d71 100644
--- a/src/libGLESv2/Context.cpp
+++ b/src/libGLESv2/Context.cpp
@@ -33,6 +33,7 @@
#include "libEGL/Surface.h"
#include <sstream>
+#include <iterator>
namespace gl
{
@@ -354,7 +355,7 @@
// wait commands finish. However, since the name becomes invalid, we cannot query the fence,
// and since our API is currently designed for being called from a single thread, we can delete
// the fence immediately.
- mResourceManager->deleteFenceSync(reinterpret_cast<GLuint>(fenceSync));
+ mResourceManager->deleteFenceSync(reinterpret_cast<uintptr_t>(fenceSync));
}
void Context::deleteVertexArray(GLuint vertexArray)
@@ -460,7 +461,7 @@
FenceSync *Context::getFenceSync(GLsync handle) const
{
- return mResourceManager->getFenceSync(reinterpret_cast<GLuint>(handle));
+ return mResourceManager->getFenceSync(reinterpret_cast<uintptr_t>(handle));
}
VertexArray *Context::getVertexArray(GLuint handle) const
diff --git a/src/libGLESv2/Framebuffer.h b/src/libGLESv2/Framebuffer.h
index cc12d22..355402c 100644
--- a/src/libGLESv2/Framebuffer.h
+++ b/src/libGLESv2/Framebuffer.h
@@ -14,7 +14,7 @@
#include "common/angleutils.h"
#include "common/RefCountObject.h"
-#include "constants.h"
+#include "Constants.h"
namespace rx
{
diff --git a/src/libGLESv2/Texture.h b/src/libGLESv2/Texture.h
index 382688f..0e13147 100644
--- a/src/libGLESv2/Texture.h
+++ b/src/libGLESv2/Texture.h
@@ -14,7 +14,7 @@
#include "common/debug.h"
#include "common/RefCountObject.h"
#include "libGLESv2/angletypes.h"
-#include "libGLESv2/constants.h"
+#include "libGLESv2/Constants.h"
#include "libGLESv2/renderer/TextureImpl.h"
#include "libGLESv2/Caps.h"
diff --git a/src/libGLESv2/VertexArray.h b/src/libGLESv2/VertexArray.h
index 882cbcd..ff6bdb9 100644
--- a/src/libGLESv2/VertexArray.h
+++ b/src/libGLESv2/VertexArray.h
@@ -14,7 +14,7 @@
#define LIBGLESV2_VERTEXARRAY_H_
#include "common/RefCountObject.h"
-#include "libGLESv2/constants.h"
+#include "libGLESv2/Constants.h"
#include "libGLESv2/VertexAttribute.h"
#include <vector>
diff --git a/src/libGLESv2/angletypes.h b/src/libGLESv2/angletypes.h
index 5f782f4..2c607a9 100644
--- a/src/libGLESv2/angletypes.h
+++ b/src/libGLESv2/angletypes.h
@@ -9,7 +9,7 @@
#ifndef LIBGLESV2_ANGLETYPES_H_
#define LIBGLESV2_ANGLETYPES_H_
-#include "libGLESv2/constants.h"
+#include "libGLESv2/Constants.h"
#include "common/RefCountObject.h"
namespace gl
diff --git a/src/libGLESv2/renderer/copyimage.cpp b/src/libGLESv2/renderer/copyimage.cpp
index 004223d..aabc9f0 100644
--- a/src/libGLESv2/renderer/copyimage.cpp
+++ b/src/libGLESv2/renderer/copyimage.cpp
@@ -6,7 +6,7 @@
// copyimage.cpp: Defines image copying functions
-#include "libGLESv2/renderer/copyImage.h"
+#include "libGLESv2/renderer/copyimage.h"
namespace rx
{
diff --git a/src/libGLESv2/renderer/copyimage.inl b/src/libGLESv2/renderer/copyimage.inl
index ea6970c..0498cf7 100644
--- a/src/libGLESv2/renderer/copyimage.inl
+++ b/src/libGLESv2/renderer/copyimage.inl
@@ -24,7 +24,7 @@
template <typename sourceType, typename destType, typename colorDataType>
inline void CopyPixel(const uint8_t *source, uint8_t *dest)
{
- colorType temp;
+ colorDataType temp;
ReadColor<sourceType, colorDataType>(source, &temp);
WriteColor<destType, colorDataType>(&temp, dest);
}
diff --git a/src/libGLESv2/renderer/d3d/DynamicHLSL.h b/src/libGLESv2/renderer/d3d/DynamicHLSL.h
index f68ed98..305a3c2 100644
--- a/src/libGLESv2/renderer/d3d/DynamicHLSL.h
+++ b/src/libGLESv2/renderer/d3d/DynamicHLSL.h
@@ -10,7 +10,7 @@
#define LIBGLESV2_RENDERER_DYNAMIC_HLSL_H_
#include "common/angleutils.h"
-#include "libGLESv2/constants.h"
+#include "libGLESv2/Constants.h"
#include "angle_gl.h"
diff --git a/src/libGLESv2/renderer/d3d/TextureD3D.cpp b/src/libGLESv2/renderer/d3d/TextureD3D.cpp
index 7a120ce..d062133 100644
--- a/src/libGLESv2/renderer/d3d/TextureD3D.cpp
+++ b/src/libGLESv2/renderer/d3d/TextureD3D.cpp
@@ -136,7 +136,7 @@
if (unpack.pixelBuffer.id() != 0)
{
gl::Buffer *pixelBuffer = unpack.pixelBuffer.get();
- unsigned int offset = reinterpret_cast<unsigned int>(pixels);
+ uintptr_t offset = reinterpret_cast<uintptr_t>(pixels);
// TODO: setImage/subImage is the only place outside of renderer that asks for a buffers raw data.
// This functionality should be moved into renderer and the getData method of BufferImpl removed.
const void *bufferData = pixelBuffer->getImplementation()->getData();
@@ -212,7 +212,7 @@
// to create a render target.
ASSERT(mRenderer->supportsFastCopyBufferToTexture(sizedInternalFormat));
- unsigned int offset = reinterpret_cast<unsigned int>(pixels);
+ uintptr_t offset = reinterpret_cast<uintptr_t>(pixels);
gl::Error error = mRenderer->fastCopyBufferToTexture(unpack, offset, destRenderTarget, sizedInternalFormat, type, destArea);
if (error.isError())
diff --git a/src/libGLESv2/renderer/d3d/TextureD3D.h b/src/libGLESv2/renderer/d3d/TextureD3D.h
index 5bfee8c..6f6bbdc 100644
--- a/src/libGLESv2/renderer/d3d/TextureD3D.h
+++ b/src/libGLESv2/renderer/d3d/TextureD3D.h
@@ -11,7 +11,7 @@
#include "libGLESv2/renderer/TextureImpl.h"
#include "libGLESv2/angletypes.h"
-#include "libGLESv2/constants.h"
+#include "libGLESv2/Constants.h"
namespace gl
{
diff --git a/src/libGLESv2/validationES.cpp b/src/libGLESv2/validationES.cpp
index 1b6180d..38c8c5e 100644
--- a/src/libGLESv2/validationES.cpp
+++ b/src/libGLESv2/validationES.cpp
@@ -1667,7 +1667,7 @@
// TODO: also disable index checking on back-ends that are robust to out-of-range accesses.
if (elementArrayBuffer)
{
- unsigned int offset = reinterpret_cast<unsigned int>(indices);
+ uintptr_t offset = reinterpret_cast<uintptr_t>(indices);
if (!elementArrayBuffer->getIndexRangeCache()->findRange(type, offset, count, indexRangeOut, NULL))
{
const void *dataPointer = elementArrayBuffer->getImplementation()->getData();
diff --git a/src/third_party/trace_event/trace_event.h b/src/third_party/trace_event/trace_event.h
index 1880056..af59dcf 100644
--- a/src/third_party/trace_event/trace_event.h
+++ b/src/third_party/trace_event/trace_event.h
@@ -587,7 +587,7 @@
class TraceID {
public:
explicit TraceID(const void* id, unsigned char* flags) :
- m_data(static_cast<unsigned long long>(reinterpret_cast<unsigned long>(id)))
+ m_data(static_cast<unsigned long long>(reinterpret_cast<uintptr_t>(id)))
{
*flags |= TRACE_EVENT_FLAG_MANGLE_ID;
}
@@ -788,37 +788,6 @@
Data m_data;
};
-// TraceEventSamplingStateScope records the current sampling state
-// and sets a new sampling state. When the scope exists, it restores
-// the sampling state having recorded.
-template<size_t BucketNumber>
-class SamplingStateScope {
-public:
- SamplingStateScope(const char* categoryAndName)
- {
- m_previousState = SamplingStateScope<BucketNumber>::current();
- SamplingStateScope<BucketNumber>::set(categoryAndName);
- }
-
- ~SamplingStateScope()
- {
- SamplingStateScope<BucketNumber>::set(m_previousState);
- }
-
- // FIXME: Make load/store to traceSamplingState[] thread-safe and atomic.
- static inline const char* current()
- {
- return reinterpret_cast<const char*>(*gl::traceSamplingState[BucketNumber]);
- }
- static inline void set(const char* categoryAndName)
- {
- *gl::traceSamplingState[BucketNumber] = reinterpret_cast<long>(const_cast<char*>(categoryAndName));
- }
-
-private:
- const char* m_previousState;
-};
-
} // namespace TraceEvent
} // namespace gl