reed@google.com | baf7a07 | 2011-05-02 19:11:37 +0000 | [diff] [blame] | 1 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 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. |
reed@google.com | baf7a07 | 2011-05-02 19:11:37 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
reed@google.com | baf7a07 | 2011-05-02 19:11:37 +0000 | [diff] [blame] | 8 | #include "SkTypes.h" |
halcanary | 4dbbd04 | 2016-06-07 17:21:10 -0700 | [diff] [blame] | 9 | |
mtklein | 1ee7651 | 2015-11-02 10:20:27 -0800 | [diff] [blame] | 10 | #if defined(SK_BUILD_FOR_WIN32) |
reed@google.com | baf7a07 | 2011-05-02 19:11:37 +0000 | [diff] [blame] | 11 | |
halcanary | 4dbbd04 | 2016-06-07 17:21:10 -0700 | [diff] [blame] | 12 | #include "SkLeanWindows.h" |
reed@google.com | baf7a07 | 2011-05-02 19:11:37 +0000 | [diff] [blame] | 13 | |
| 14 | #include <stdarg.h> |
| 15 | #include <stdio.h> |
halcanary | 4dbbd04 | 2016-06-07 17:21:10 -0700 | [diff] [blame] | 16 | |
| 17 | static const size_t kBufferSize = 2048; |
reed@google.com | baf7a07 | 2011-05-02 19:11:37 +0000 | [diff] [blame] | 18 | |
| 19 | void SkDebugf(const char format[], ...) { |
| 20 | char buffer[kBufferSize + 1]; |
| 21 | va_list args; |
bsalomon@google.com | 8890af3 | 2013-03-07 18:44:34 +0000 | [diff] [blame] | 22 | |
| 23 | va_start(args, format); |
mtklein | bdef140 | 2015-10-28 09:50:31 -0700 | [diff] [blame] | 24 | vfprintf(stderr, format, args); |
bsalomon@google.com | 8890af3 | 2013-03-07 18:44:34 +0000 | [diff] [blame] | 25 | va_end(args); |
mtklein | e4881b6 | 2015-10-28 10:02:06 -0700 | [diff] [blame] | 26 | fflush(stderr); // stderr seems to be buffered on Windows. |
bsalomon@google.com | 8890af3 | 2013-03-07 18:44:34 +0000 | [diff] [blame] | 27 | |
reed@google.com | baf7a07 | 2011-05-02 19:11:37 +0000 | [diff] [blame] | 28 | va_start(args, format); |
| 29 | vsnprintf(buffer, kBufferSize, format, args); |
| 30 | va_end(args); |
| 31 | |
reed@google.com | 59d2f63 | 2011-05-02 19:36:59 +0000 | [diff] [blame] | 32 | OutputDebugStringA(buffer); |
reed@google.com | baf7a07 | 2011-05-02 19:11:37 +0000 | [diff] [blame] | 33 | } |
mtklein | 1ee7651 | 2015-11-02 10:20:27 -0800 | [diff] [blame] | 34 | #endif//defined(SK_BUILD_FOR_WIN32) |