Commit 153f3c22 by James Darpinian Committed by Commit Bot

Miscellaneous build fixes for WebKit

Add a USE_SYSTEM_EGL define to allow compilation on Unix systems without X11. Feature detect __popcnt using Microsoft-specific _MSC_VER rather than _M_X64/_M_IX86, which can be set by the Dinkumware stdlib on non-Microsoft systems. Apple's clang is too old to have -Wextra-semi-stmt Ran generate_parser.sh using Cygwin64 bison 3.0.4, flex 2.6.4 Bug: 3439 Change-Id: Ie0d01a112a17f70ef60c120063a958b8f1a094f4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1759135 Commit-Queue: James Darpinian <jdarpinian@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarKenneth Russell <kbr@chromium.org>
parent 2f07e4fb
......@@ -110,7 +110,7 @@ typedef void* EGLNativeDisplayType;
typedef struct egl_native_pixmap_t* EGLNativePixmapType;
typedef struct ANativeWindow* EGLNativeWindowType;
#elif defined(USE_OZONE)
#elif defined(USE_OZONE) || defined(USE_SYSTEM_EGL)
typedef intptr_t EGLNativeDisplayType;
typedef intptr_t EGLNativePixmapType;
......
......@@ -979,7 +979,7 @@ inline uint32_t BitfieldReverse(uint32_t value)
}
// Count the 1 bits.
#if defined(_M_IX86) || defined(_M_X64)
#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
# define ANGLE_HAS_BITCOUNT_32
inline int BitCount(uint32_t bits)
{
......
......@@ -699,7 +699,12 @@ IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh.
#endif
#if defined(__clang__)
// Flex uses `/*FALLTHROUGH*/` instead of dedicated statements.
# pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
# pragma clang diagnostic ignored "-Wimplicit-fallthrough"
# if defined(__APPLE__)
// Older clang versions don't have -Wextra-semi-stmt, and detecting Apple clang versions is
// difficult because they use different yet overlapping version numbers vs. regular clang.
# pragma clang diagnostic ignored "-Wunknown-warning-option"
# endif
// Flex isn't semi-colon clean.
# pragma clang diagnostic ignored "-Wextra-semi-stmt"
# pragma clang diagnostic ignored "-Wunreachable-code"
......
......@@ -40,7 +40,12 @@ IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh.
#endif
#if defined(__clang__)
// Flex uses `/*FALLTHROUGH*/` instead of dedicated statements.
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
#if defined(__APPLE__)
// Older clang versions don't have -Wextra-semi-stmt, and detecting Apple clang versions is
// difficult because they use different yet overlapping version numbers vs. regular clang.
#pragma clang diagnostic ignored "-Wunknown-warning-option"
#endif
// Flex isn't semi-colon clean.
#pragma clang diagnostic ignored "-Wextra-semi-stmt"
#pragma clang diagnostic ignored "-Wunreachable-code"
......
......@@ -39,7 +39,12 @@ WHICH GENERATES THE GLSL ES LEXER (glslang_lex.cpp).
#pragma warning(disable: 4702)
#endif
#if defined(__clang__)
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
#if defined(__APPLE__)
// Older clang versions don't have -Wextra-semi-stmt, and detecting Apple clang versions is
// difficult because they use different yet overlapping version numbers vs. regular clang.
#pragma clang diagnostic ignored "-Wunknown-warning-option"
#endif
// Flex isn't semi-colon clean.
#pragma clang diagnostic ignored "-Wextra-semi-stmt"
#pragma clang diagnostic ignored "-Wunreachable-code"
......
......@@ -24,7 +24,12 @@
#pragma warning(disable: 4702)
#endif
#if defined(__clang__)
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
#if defined(__APPLE__)
// Older clang versions don't have -Wextra-semi-stmt, and detecting Apple clang versions is
// difficult because they use different yet overlapping version numbers vs. regular clang.
#pragma clang diagnostic ignored "-Wunknown-warning-option"
#endif
// Flex isn't semi-colon clean.
#pragma clang diagnostic ignored "-Wextra-semi-stmt"
#pragma clang diagnostic ignored "-Wunreachable-code"
......
......@@ -148,7 +148,7 @@ bool VertexArray::detachBuffer(const Context *context, GLuint bufferName)
{
bool isBound = context->isCurrentVertexArray(this);
bool anyBufferDetached = false;
for (size_t bindingIndex = 0; bindingIndex < gl::MAX_VERTEX_ATTRIB_BINDINGS; ++bindingIndex)
for (uint32_t bindingIndex = 0; bindingIndex < gl::MAX_VERTEX_ATTRIB_BINDINGS; ++bindingIndex)
{
VertexBinding &binding = mState.mVertexBindings[bindingIndex];
if (binding.getBuffer().id() == bufferName)
......@@ -167,8 +167,11 @@ bool VertexArray::detachBuffer(const Context *context, GLuint bufferName)
}
else
{
static_assert(gl::MAX_VERTEX_ATTRIB_BINDINGS < 8 * sizeof(uint32_t),
"Not enough bits in bindingIndex");
// The redundant uint32_t cast here is required to avoid a warning on MSVC.
ASSERT(binding.getBoundAttributesMask() ==
AttributesMask(static_cast<size_t>(1) << bindingIndex));
AttributesMask(static_cast<uint32_t>(1 << bindingIndex)));
setDirtyAttribBit(bindingIndex, DIRTY_ATTRIB_POINTER);
}
......
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