epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
reed@google.com | baf7a07 | 2011-05-02 19:11:37 +0000 | [diff] [blame] | 2 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 3 | * Copyright 2010 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
reed@google.com | baf7a07 | 2011-05-02 19:11:37 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 10 | |
reed@google.com | baf7a07 | 2011-05-02 19:11:37 +0000 | [diff] [blame] | 11 | #include "SkTypes.h" |
mtklein | 1ee7651 | 2015-11-02 10:20:27 -0800 | [diff] [blame^] | 12 | #if defined(SK_BUILD_FOR_WIN32) |
reed@google.com | baf7a07 | 2011-05-02 19:11:37 +0000 | [diff] [blame] | 13 | |
| 14 | static const size_t kBufferSize = 2048; |
| 15 | |
| 16 | #include <stdarg.h> |
| 17 | #include <stdio.h> |
bungeman@google.com | 0d9e3da | 2013-12-03 15:23:37 +0000 | [diff] [blame] | 18 | #include <windows.h> |
reed@google.com | baf7a07 | 2011-05-02 19:11:37 +0000 | [diff] [blame] | 19 | |
| 20 | void SkDebugf(const char format[], ...) { |
| 21 | char buffer[kBufferSize + 1]; |
| 22 | va_list args; |
bsalomon@google.com | 8890af3 | 2013-03-07 18:44:34 +0000 | [diff] [blame] | 23 | |
| 24 | va_start(args, format); |
mtklein | bdef140 | 2015-10-28 09:50:31 -0700 | [diff] [blame] | 25 | vfprintf(stderr, format, args); |
bsalomon@google.com | 8890af3 | 2013-03-07 18:44:34 +0000 | [diff] [blame] | 26 | va_end(args); |
mtklein | e4881b6 | 2015-10-28 10:02:06 -0700 | [diff] [blame] | 27 | fflush(stderr); // stderr seems to be buffered on Windows. |
bsalomon@google.com | 8890af3 | 2013-03-07 18:44:34 +0000 | [diff] [blame] | 28 | |
reed@google.com | baf7a07 | 2011-05-02 19:11:37 +0000 | [diff] [blame] | 29 | va_start(args, format); |
| 30 | vsnprintf(buffer, kBufferSize, format, args); |
| 31 | va_end(args); |
| 32 | |
reed@google.com | 59d2f63 | 2011-05-02 19:36:59 +0000 | [diff] [blame] | 33 | OutputDebugStringA(buffer); |
reed@google.com | baf7a07 | 2011-05-02 19:11:37 +0000 | [diff] [blame] | 34 | } |
mtklein | 1ee7651 | 2015-11-02 10:20:27 -0800 | [diff] [blame^] | 35 | #endif//defined(SK_BUILD_FOR_WIN32) |