Summary: | FileHandle::printf doesn't build on Windows | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Keith Rollin <krollin> | ||||
Component: | WebCore Misc. | Assignee: | Keith Rollin <krollin> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | commit-queue, darin | ||||
Priority: | P2 | ||||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Keith Rollin
2016-12-08 18:34:33 PST
Created attachment 296609 [details]
Patch
Comment on attachment 296609 [details] Patch Clearing flags on attachment: 296609 Committed r209593: <http://trac.webkit.org/changeset/209593> All reviewed patches have been landed. Closing bug. 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())); That version should work fine on other platforms too. I put up a patch with the above code in bug 165740. |