2 * Copyright 2011 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #include "include/core/SkTypes.h"
9 #if defined(SK_BUILD_FOR_WIN)
11 #include "src/utils/win/SkHRESULT.h"
13 void SkTraceHR(const char* file, unsigned long line, HRESULT hr, const char* msg) {
15 SkDebugf("%s\n", msg);
17 SkDebugf("%s(%lu) : error 0x%lx: ", file, line, hr);
19 LPSTR errorText = nullptr;
20 FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
21 FORMAT_MESSAGE_FROM_SYSTEM |
22 FORMAT_MESSAGE_IGNORE_INSERTS,
25 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
31 if (nullptr == errorText) {
32 SkDebugf("<unknown>\n");
34 SkDebugf("%s", errorText);
40 #endif//defined(SK_BUILD_FOR_WIN)