blob: 7ab21cdb0fd9cb5901288001d5b5b410cbab6988 [file]
/*
* Copyright 2010 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <cstdarg>
#include "include/private/SkDebug.h"
#include "include/private/SkFeatures.h"
#include "include/private/SkLog.h"
#if defined(SK_BUILD_FOR_WIN)
#include "src/core/SkLeanWindows.h"
#include <stdarg.h>
#include <stdio.h>
static const size_t kBufferSize = 2048;
void SkLogVAList(SkLogPriority priority, const char format[], va_list args) {
char buffer[kBufferSize + 1];
va_list args_copy;
va_copy(args_copy, args);
vfprintf(stderr, format, args_copy);
va_end(args_copy);
fflush(stderr); // stderr seems to be buffered on Windows.
vsnprintf(buffer, kBufferSize, format, args);
OutputDebugStringA(buffer);
}
#endif // defined(SK_BUILD_FOR_WIN)