Debian Codegraph @

src/ports/SkLog_win.cpp

raw
1 /*
2 * Copyright 2010 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include <cstdarg>
9 #include "include/private/base/SkDebug.h"
10 #include "include/private/base/SkFeatures.h"
11 #include "include/private/base/SkLog.h"
12
13 #if defined(SK_BUILD_FOR_WIN)
14
15 #include "src/base/SkLeanWindows.h"
16
17 #include <stdarg.h>
18 #include <stdio.h>
19
20 static const size_t kBufferSize = 2048;
21
22 void SkLogVAList(SkLogPriority priority, const char format[], va_list args) {
23 char buffer[kBufferSize + 1];
24 va_list args_copy;
25
26 va_copy(args_copy, args);
27 vfprintf(stderr, format, args_copy);
28 va_end(args_copy);
29 fflush(stderr); // stderr seems to be buffered on Windows.
30
31 vsnprintf(buffer, kBufferSize, format, args);
32
33 OutputDebugStringA(buffer);
34 }
35 #endif // defined(SK_BUILD_FOR_WIN)