Bug 143768

Summary: [W32][GTK] Conflict between NO_ERROR from W32API and GraphicsContext3D
Product: WebKit Reporter: LRN <lrn1986>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: cgarcia, cmarcelo, commit-queue, dino, esprehn+autocc, gyuyoung.kim, kondapallykalyan, lrn1986, luiz, noam, roger_fong
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 133028    
Attachments:
Description Flags
Work around name conflicts (NO_ERROR)
none
Work around name conflicts (NO_ERROR) cgarcia: review+, cgarcia: commit-queue-

Description LRN 2015-04-15 06:30:55 PDT
In file included from /mingw/include/_mingw.h:12:0,
                 from ../webkitgtk-2.4.8/Source/WTF/wtf/Compiler.h:93,
                 from ../webkitgtk-2.4.8/Source/WTF/wtf/Platform.h:32,
                 from ../webkitgtk-2.4.8/Source/JavaScriptCore/config.h:30,
                 from ../webkitgtk-2.4.8/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:27:
../webkitgtk-2.4.8/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp: In member function 'virtual int WebCore::Extensions3DOpenGLCommon::getGraphicsResetStatusARB()':
../webkitgtk-2.4.8/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:144:31: error: expected unqualified-id before numeric constant
     return GraphicsContext3D::NO_ERROR;

because NO_ERROR is also a macro defined in Windows headers. Ouch.
Comment 1 LRN 2015-04-15 10:08:52 PDT
Created attachment 250814 [details]
Work around name conflicts (NO_ERROR)

In file included from /mingw/include/_mingw.h:12:0,
                 from ../webkitgtk-2.4.8/Source/WTF/wtf/Compiler.h:93,
                 from ../webkitgtk-2.4.8/Source/WTF/wtf/Platform.h:32,
                 from ../webkitgtk-2.4.8/Source/JavaScriptCore/config.h:30,
                 from ../webkitgtk-2.4.8/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:27:
../webkitgtk-2.4.8/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp: In member function 'virtual int WebCore::Extensions3DOpenGLCommon::getGraphicsResetStatusARB()':
../webkitgtk-2.4.8/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:144:31: error: expected unqualified-id before numeric constant
     return GraphicsContext3D::NO_ERROR;

because NO_ERROR is also a macro defined in Windows headers. Ouch.
Also expand this to the (PLATFORM(GTK) && OS(WINDOWS)) combination,
in addition to the workaround for VERSION already present there.
Comment 2 WebKit Commit Bot 2015-04-15 10:10:48 PDT
Attachment 250814 [details] did not pass style-queue:


ERROR: Source/WebCore/ChangeLog:23:  You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]
Total errors found: 1 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 LRN 2015-04-15 13:15:15 PDT
Created attachment 250842 [details]
Work around name conflicts (NO_ERROR)

In file included from /mingw/include/_mingw.h:12:0,
                 from ../webkitgtk-2.4.8/Source/WTF/wtf/Compiler.h:93,
                 from ../webkitgtk-2.4.8/Source/WTF/wtf/Platform.h:32,
                 from ../webkitgtk-2.4.8/Source/JavaScriptCore/config.h:30,
                 from ../webkitgtk-2.4.8/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:27:
../webkitgtk-2.4.8/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp: In member function 'virtual int WebCore::Extensions3DOpenGLCommon::getGraphicsResetStatusARB()':
../webkitgtk-2.4.8/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:144:31: error: expected unqualified-id before numeric constant
     return GraphicsContext3D::NO_ERROR;

because NO_ERROR is also a macro defined in Windows headers. Ouch.
Also expand this to the (PLATFORM(GTK) && OS(WINDOWS)) combination,
in addition to the workaround for VERSION already present there.
Comment 4 Carlos Garcia Campos 2015-05-18 23:14:39 PDT
Comment on attachment 250842 [details]
Work around name conflicts (NO_ERROR)

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

I don't understand why the workaround needs to be duplicated, but LRN confirmed it doesn't build otherwise.

> Source/WebCore/html/canvas/WebGLRenderingContext.cpp:88
> +#if PLATFORM(WIN) || (PLATFORM(QT) && OS(WINDOWS)) || (PLATFORM(GTK) && OS(WINDOWS))

I'll remove the QT thing before landing
Comment 5 Carlos Garcia Campos 2015-05-18 23:15:37 PDT
Committed to 2.4 http://trac.webkit.org/changeset/184545