Bug 55534 - Clean up macros in Extensions3DOpenGL.cpp
Summary: Clean up macros in Extensions3DOpenGL.cpp
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-01 17:18 PST by David Kilzer (:ddkilzer)
Modified: 2011-03-02 06:55 PST (History)
5 users (show)

See Also:


Attachments
Patch (2.92 KB, patch)
2011-03-01 17:18 PST, David Kilzer (:ddkilzer)
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2011-03-01 17:18:39 PST
Created attachment 84332 [details]
Patch

Reviewed by NOBODY (OOPS!).

Change "#if GL_APPLE_vertex_array_object" macros to check that
GL_APPLE_vertex_array_object is both defined and non-zero.

* platform/graphics/opengl/Extensions3DOpenGL.cpp:
(WebCore::Extensions3DOpenGL::createVertexArrayOES):
(WebCore::Extensions3DOpenGL::deleteVertexArrayOES): Remove
empty #else clause.
(WebCore::Extensions3DOpenGL::isVertexArrayOES):
(WebCore::Extensions3DOpenGL::bindVertexArrayOES): Add early
return check.  Remove #else clause that would never have
compiled (since array is not a WTF::String).
---
 2 files changed, 25 insertions(+), 7 deletions(-)
Comment 1 Darin Adler 2011-03-01 17:31:30 PST
Comment on attachment 84332 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=84332&action=review

> Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp:137
> -#if GL_APPLE_vertex_array_object
> +#if defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object

I think this only works properly in MSVC if you leave off the parentheses.

    #if defined GL_APPLE_vertex_array_object && GL_APPLE_vertex_array_object

I think it would be best to use the syntax that works in MSVC even if that’s not a real issue here.
Comment 2 David Kilzer (:ddkilzer) 2011-03-02 06:46:37 PST
(In reply to comment #1)
> I think it would be best to use the syntax that works in MSVC even if that’s not a real issue here.

Done.
Comment 3 David Kilzer (:ddkilzer) 2011-03-02 06:48:47 PST
Committed r80124: <http://trac.webkit.org/changeset/80124>
Comment 4 Adam Roben (:aroben) 2011-03-02 06:55:35 PST
(In reply to comment #1)
> (From update of attachment 84332 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=84332&action=review
> 
> > Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp:137
> > -#if GL_APPLE_vertex_array_object
> > +#if defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
> 
> I think this only works properly in MSVC if you leave off the parentheses.
> 
>     #if defined GL_APPLE_vertex_array_object && GL_APPLE_vertex_array_object
> 
> I think it would be best to use the syntax that works in MSVC even if that’s not a real issue here.

I believe MSVC can handle the parentheses in this case just fine. For some reason it doesn't like them if you add them to the definition of the PLATFORM() macro, though; maybe it's something about the ## operator?