<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">I seem to remember I fixed it last time by calling the WTF::Function constructor explicitly.<br><br><div id="AppleMailSignature"><div style="direction: inherit;">Chris Dumez</div></div><div><br>On Jul 15, 2017, at 9:14 AM, Yusuke SUZUKI <<a href="mailto:utatane.tea@gmail.com">utatane.tea@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">I'm not 100% confident, but can you try it `&<span style="font-size:12.8px">testFunction` instead?</span></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Regards,<br>Yusuke Suzuki</div></div></div></div>
<br><div class="gmail_quote">On Sun, Jul 16, 2017 at 1:13 AM, Darin Adler <span dir="ltr"><<a href="mailto:darin@apple.com" target="_blank">darin@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi folks.<br>
<br>
On Windows, WTF::Function doesn’t quite work right. Code that is something like this:<br>
<br>
void addCallback(WTF::Function<<wbr>void()>&&);<br>
<br>
void testFunction()<br>
{<br>
// ...<br>
}<br>
<br>
void addTestFunction()<br>
{<br>
addCallback(testFunction);<br>
}<br>
<br>
Leads to errors like this:<br>
<br>
error C2664: 'void addCallback(WTF::Function<void (void)> &&)': cannot convert argument 1 from 'void (__cdecl *)(void)' to 'WTF::Function<void (void)> &&'<br>
note: You cannot bind an lvalue to an rvalue reference<br>
<br>
The problem might have something to do with cdecl vs. stdcall functions, but I am not sure that is the problem. It could be some other problem with how WTF::Function is written. Or it might even be a bug in the Visual Studio compiler. Since I don’t have a Windows machine myself, I was trying to use EWS to figure this out but that was slow. Then I tried using <a href="http://webcompiler.cloudapp.net" rel="noreferrer" target="_blank">http://webcompiler.cloudapp.<wbr>net</a> but I could not reproduce any error there when I pasted in cut down code; it just compiled fine.<br>
<br>
Is there someone who knows how to fix this?<br>
<br>
Another way to put this is: We want to take off the explicit WTF::Function conversions in functions like canUseWithReason in SimpleLineLayout.cpp, Page::Page in Page.cpp, and Worker::Worker in Worker.cpp and have it still compile and work on Windows. Other platforms seem to compile fine without the explicit WTF::Function.<br>
<br>
— Darin<br>
______________________________<wbr>_________________<br>
webkit-dev mailing list<br>
<a href="mailto:webkit-dev@lists.webkit.org">webkit-dev@lists.webkit.org</a><br>
<a href="https://lists.webkit.org/mailman/listinfo/webkit-dev" rel="noreferrer" target="_blank">https://lists.webkit.org/<wbr>mailman/listinfo/webkit-dev</a><br>
</blockquote></div><br></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>webkit-dev mailing list</span><br><span><a href="mailto:webkit-dev@lists.webkit.org">webkit-dev@lists.webkit.org</a></span><br><span><a href="https://lists.webkit.org/mailman/listinfo/webkit-dev">https://lists.webkit.org/mailman/listinfo/webkit-dev</a></span><br></div></blockquote></body></html>