RESOLVED FIXED 131006
std::bind not compiling with Visual Studio
https://bugs.webkit.org/show_bug.cgi?id=131006
Summary std::bind not compiling with Visual Studio
Alex Christensen
Reported 2014-03-31 20:33:55 PDT
I'm getting lots of compile errors like this when compiling after r166496 and I'm trying to avoid adding template parameters everywhere. This is a shot-in-the dark solution. 1>..\platform\graphics\gstreamer\WebKitWebSourceGStreamer.cpp(745): error C2668: 'WTF::GMainLoopSource::schedule' : ambiguous call to overloaded function C:\Projects\BuildSlave\win-cairo-release\build\WebKitBuild\Release_WinCairo\include\private\wtf/gobject/GMainLoopSource.h(55): could be 'void WTF::GMainLoopSource::schedule(const char *,std::function<bool (GIOCondition)>,GSocket *,GIOCondition,std::function<void (void)>,GMainContext *)' C:\Projects\BuildSlave\win-cairo-release\build\WebKitBuild\Release_WinCairo\include\private\wtf/gobject/GMainLoopSource.h(54): or 'void WTF::GMainLoopSource::schedule(const char *,std::function<bool (void)>,int,std::function<void (void)>,GMainContext *)' C:\Projects\BuildSlave\win-cairo-release\build\WebKitBuild\Release_WinCairo\include\private\wtf/gobject/GMainLoopSource.h(53): or 'void WTF::GMainLoopSource::schedule(const char *,std::function<void (void)>,int,std::function<void (void)>,GMainContext *)' while trying to match the argument list '(const char [32], std::_Bind<true,void,void (__cdecl *const )(WebKitWebSrc *),WebKitWebSrc *&>, int, webKitWebSrcSeekDataCb::<lambda_d0654a0fb2d903f9cc92bf36e3e47024>)'
Attachments
Patch (2.21 KB, patch)
2014-03-31 20:37 PDT, Alex Christensen
no flags
Patch (4.90 KB, patch)
2014-03-31 20:50 PDT, Alex Christensen
no flags
Patch (12.83 KB, patch)
2014-04-01 13:09 PDT, Alex Christensen
no flags
Alex Christensen
Comment 1 2014-03-31 20:37:03 PDT
Alex Christensen
Comment 2 2014-03-31 20:50:11 PDT
Carlos Garcia Campos
Comment 3 2014-04-01 00:28:12 PDT
Comment on attachment 228238 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=228238&action=review We use the versions with the bool function to decide whether to use g_idle or g_timeout, if you remove the versions receiving a bool function it's impossible to implement a repeating source. I guess the problem with visual studio is that the compiler doesn't know which one to use, so a possible workaround would be to add a cast in the callers, see the discussion here: https://bugs.webkit.org/show_bug.cgi?id=130027#c15 > Source/WTF/ChangeLog:4 > + [WinCairo] Build fix after r166496. > + https://bugs.webkit.org/show_bug.cgi?id=131006 Removing the code that doesn't build for you is not a build fix :-)
Alex Christensen
Comment 4 2014-04-01 13:03:08 PDT
> Removing the code that doesn't build for you is not a build fix :-) That's why it was a shot in the dark. I was just hoping that nobody would ever need to use the bool version :) I added some std::function<void ()> constructors. I was going to add static_casts, but I think this is a better solution.
Alex Christensen
Comment 5 2014-04-01 13:09:19 PDT
Carlos Garcia Campos
Comment 6 2014-04-01 23:50:03 PDT
Comment on attachment 228311 [details] Patch Thanks for confirming that was indeed the problem, and sorry for the build break.
WebKit Commit Bot
Comment 7 2014-04-02 07:28:09 PDT
Comment on attachment 228311 [details] Patch Clearing flags on attachment: 228311 Committed r166643: <http://trac.webkit.org/changeset/166643>
WebKit Commit Bot
Comment 8 2014-04-02 07:28:15 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.