diff options
Diffstat (limited to 'Source/WTF/wtf/PrintStream.cpp')
-rw-r--r-- | Source/WTF/wtf/PrintStream.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Source/WTF/wtf/PrintStream.cpp b/Source/WTF/wtf/PrintStream.cpp index bb7d39db9..97faf3031 100644 --- a/Source/WTF/wtf/PrintStream.cpp +++ b/Source/WTF/wtf/PrintStream.cpp @@ -28,6 +28,7 @@ #include <stdio.h> #include <wtf/text/CString.h> +#include <wtf/text/UniquedStringImpl.h> #include <wtf/text/WTFString.h> namespace WTF { @@ -43,15 +44,49 @@ void PrintStream::printf(const char* format, ...) va_end(argList); } +void PrintStream::printfVariableFormat(const char* format, ...) +{ +#if COMPILER(CLANG) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wformat-nonliteral" +#elif COMPILER(GCC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-attribute=format" +#endif + va_list argList; + va_start(argList, format); + vprintf(format, argList); + va_end(argList); +#if COMPILER(CLANG) +#pragma clang diagnostic pop +#elif COMPILER(GCC) +#pragma GCC diagnostic pop +#endif +} + void PrintStream::flush() { } +PrintStream& PrintStream::begin() +{ + return *this; +} + +void PrintStream::end() +{ +} + void printInternal(PrintStream& out, const char* string) { out.printf("%s", string); } +void printInternal(PrintStream& out, const StringView& string) +{ + out.print(string.utf8()); +} + void printInternal(PrintStream& out, const CString& string) { out.print(string.data()); |