OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkHRESULT_DEFINED | 8 #ifndef SkHRESULT_DEFINED |
9 #define SkHRESULT_DEFINED | 9 #define SkHRESULT_DEFINED |
10 | 10 |
11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
12 | 12 |
13 void SkTraceHR(const char* file, unsigned long line, | 13 void SkTraceHR(const char* file, unsigned long line, |
14 HRESULT hr, const char* msg); | 14 HRESULT hr, const char* msg); |
15 | 15 |
16 #ifdef SK_DEBUG | 16 #ifdef SK_DEBUG |
17 #define SK_TRACEHR(_hr, _msg) SkTraceHR(__FILE__, __LINE__, _hr, _msg) | 17 #define SK_TRACEHR(_hr, _msg) SkTraceHR(__FILE__, __LINE__, _hr, _msg) |
18 #else | 18 #else |
19 #define SK_TRACEHR(_hr, _msg) _hr | 19 #define SK_TRACEHR(_hr, _msg) |
bungeman-skia
2015/12/06 21:03:47
I will say that this existing code is odd, in that
Nico
2015/12/07 17:42:28
Done. (It looks like skia isn't built with unused
| |
20 #endif | 20 #endif |
21 | 21 |
22 #define HR_GENERAL(_ex, _msg, _ret) {\ | 22 #define HR_GENERAL(_ex, _msg, _ret) {\ |
23 HRESULT _hr = _ex;\ | 23 HRESULT _hr = _ex;\ |
24 if (FAILED(_hr)) {\ | 24 if (FAILED(_hr)) {\ |
25 SK_TRACEHR(_hr, _msg);\ | 25 SK_TRACEHR(_hr, _msg);\ |
26 return _ret;\ | 26 return _ret;\ |
27 }\ | 27 }\ |
28 } | 28 } |
29 | 29 |
(...skipping 19 matching lines...) Expand all Loading... | |
49 #define HRN(ex) HR_GENERAL(ex, NULL, NULL) | 49 #define HRN(ex) HR_GENERAL(ex, NULL, NULL) |
50 #define HRNM(ex, msg) HR_GENERAL(ex, msg, NULL) | 50 #define HRNM(ex, msg) HR_GENERAL(ex, msg, NULL) |
51 | 51 |
52 #define HRV(ex) HR_GENERAL(ex, NULL, ) | 52 #define HRV(ex) HR_GENERAL(ex, NULL, ) |
53 #define HRVM(ex, msg) HR_GENERAL(ex, msg, ) | 53 #define HRVM(ex, msg) HR_GENERAL(ex, msg, ) |
54 | 54 |
55 #define HRZ(ex) HR_GENERAL(ex, NULL, 0) | 55 #define HRZ(ex) HR_GENERAL(ex, NULL, 0) |
56 #define HRZM(ex, msg) HR_GENERAL(ex, msg, 0) | 56 #define HRZM(ex, msg) HR_GENERAL(ex, msg, 0) |
57 //@} | 57 //@} |
58 #endif | 58 #endif |
OLD | NEW |