Bug 223577

Summary: [GTK] X11 build fixes
Product: WebKit Reporter: Philippe Normand <pnormand>
Component: WebKitGTKAssignee: Philippe Normand <pnormand>
Status: RESOLVED FIXED    
Severity: Normal CC: aperez, bugs-noreply, cmarcelo, ews-watchlist, gyuyoung.kim, luiz, psaavedra, ryuan.choi, sergio, zeno
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=223684
Attachments:
Description Flags
Patch
none
Patch none

Description Philippe Normand 2021-03-22 08:35:09 PDT
It is this time of the year when X11 macros leak everywhere again.
Comment 1 Philippe Normand 2021-03-22 08:40:31 PDT
Created attachment 423888 [details]
Patch
Comment 2 Philippe Normand 2021-03-22 11:39:54 PDT
EWS fails:

ThreadedCompositor.cpp:89:51: error: invalid ‘static_cast’ from type ‘uint64_t’ {aka ‘long unsigned int’} to type ‘GLNativeWindowType’ {aka ‘void*’}
Comment 3 Philippe Normand 2021-03-23 06:51:50 PDT
Created attachment 424013 [details]
Patch
Comment 4 EWS 2021-03-23 08:17:13 PDT
Committed r274869: <https://commits.webkit.org/r274869>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 424013 [details].
Comment 5 Pablo Saavedra 2021-03-24 02:48:17 PDT
(In reply to Philippe Normand from comment #2)
> EWS fails:
> 
> ThreadedCompositor.cpp:89:51: error: invalid ‘static_cast’ from type
> ‘uint64_t’ {aka ‘long unsigned int’} to type ‘GLNativeWindowType’ {aka
> ‘void*’}

I'm getting a similar issue building wpewebkit (main) for ARMv7 (raspberry-pi using mesa driver). Based on https://bug-178090-attachments.webkit.org/attachment.cgi?id=323356 I have created a patch for this in https://bugs.webkit.org/show_bug.cgi?id=223684.
Comment 6 Philippe Normand 2021-03-24 03:00:10 PDT
Comment on attachment 424013 [details]
Patch

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

> Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:94
> +#if CPU(ADDRESS64)
> +    auto windowType = reinterpret_cast<GLNativeWindowType>(m_nativeSurfaceHandle);
> +#else
> +    // On 32-bit platforms GLNativeWindowType is an integer type, which cannot be casted with reinterpret_cast.
> +    auto windowType = static_cast<GLNativeWindowType>(m_nativeSurfaceHandle);
> +#endif

So this doesn't work for you?
Comment 7 Pablo Saavedra 2021-03-24 04:01:46 PDT
(In reply to Philippe Normand from comment #6)
> Comment on attachment 424013 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=424013&action=review
> 
> > Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:94
> > +#if CPU(ADDRESS64)
> > +    auto windowType = reinterpret_cast<GLNativeWindowType>(m_nativeSurfaceHandle);
> > +#else
> > +    // On 32-bit platforms GLNativeWindowType is an integer type, which cannot be casted with reinterpret_cast.
> > +    auto windowType = static_cast<GLNativeWindowType>(m_nativeSurfaceHandle);
> > +#endif
> 
> So this doesn't work for you?

No. it doesn't works. you can see my proposal based on a previous solution did by Adrián in a previous patch.