blob: 6e0576652f54754a2430b6349850a49317d1ac68 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
reed@google.combaf7a072011-05-02 19:11:37 +00002/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00003 * 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.combaf7a072011-05-02 19:11:37 +00007 */
8
9
epoger@google.comec3ed6a2011-07-28 14:26:00 +000010
reed@google.combaf7a072011-05-02 19:11:37 +000011#include "SkTypes.h"
mtklein1ee76512015-11-02 10:20:27 -080012#if defined(SK_BUILD_FOR_WIN32)
reed@google.combaf7a072011-05-02 19:11:37 +000013
14static const size_t kBufferSize = 2048;
15
16#include <stdarg.h>
17#include <stdio.h>
bungeman@google.com0d9e3da2013-12-03 15:23:37 +000018#include <windows.h>
reed@google.combaf7a072011-05-02 19:11:37 +000019
20void SkDebugf(const char format[], ...) {
21 char buffer[kBufferSize + 1];
22 va_list args;
bsalomon@google.com8890af32013-03-07 18:44:34 +000023
24 va_start(args, format);
mtkleinbdef1402015-10-28 09:50:31 -070025 vfprintf(stderr, format, args);
bsalomon@google.com8890af32013-03-07 18:44:34 +000026 va_end(args);
mtkleine4881b62015-10-28 10:02:06 -070027 fflush(stderr); // stderr seems to be buffered on Windows.
bsalomon@google.com8890af32013-03-07 18:44:34 +000028
reed@google.combaf7a072011-05-02 19:11:37 +000029 va_start(args, format);
30 vsnprintf(buffer, kBufferSize, format, args);
31 va_end(args);
32
reed@google.com59d2f632011-05-02 19:36:59 +000033 OutputDebugStringA(buffer);
reed@google.combaf7a072011-05-02 19:11:37 +000034}
mtklein1ee76512015-11-02 10:20:27 -080035#endif//defined(SK_BUILD_FOR_WIN32)