RESOLVED FIXED 165642
FileHandle::printf doesn't build on Windows
https://bugs.webkit.org/show_bug.cgi?id=165642
Summary FileHandle::printf doesn't build on Windows
Keith Rollin
Reported 2016-12-08 18:34:33 PST
vasprintf doesn't exist on Windows.
Attachments
Patch (1.59 KB, patch)
2016-12-08 18:36 PST, Keith Rollin
no flags
Keith Rollin
Comment 1 2016-12-08 18:36:30 PST
WebKit Commit Bot
Comment 2 2016-12-08 19:10:30 PST
Comment on attachment 296609 [details] Patch Clearing flags on attachment: 296609 Committed r209593: <http://trac.webkit.org/changeset/209593>
WebKit Commit Bot
Comment 3 2016-12-08 19:10:34 PST
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 4 2016-12-09 21:38:10 PST
Comment on attachment 296609 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=296609&action=review > Source/WebCore/platform/FileHandle.cpp:105 > + // TODO: implement this without relying on vasprintf. > + return false; Looked up how to do it here <http://en.cppreference.com/w/cpp/io/c/vfprintf>: va_list args; va_start(args, format); va_list preflightArgs; va_copy(preflightArgs, args); Vector<char, 1024> buffer { 1 + std::vsnprintf(nullptr, 0, format, preflightArgs) }; va_end(preflightArgs); std::vsnprintf(buffer.data(), buffer.size(), format, args); va_end(args); return write(buffer.data(), strlen(buffer.data()));
Darin Adler
Comment 5 2016-12-09 21:38:31 PST
That version should work fine on other platforms too.
Darin Adler
Comment 6 2016-12-10 18:16:18 PST
I put up a patch with the above code in bug 165740.
Note You need to log in before you can comment on or make changes to this bug.