Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: include/utils/win/SkHRESULT.h

Issue 2070983002: Move headers in include/utils/win to src/utils/win. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Really rebase. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/utils/win/SkAutoCoInitialize.h ('k') | include/utils/win/SkIStream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2011 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef SkHRESULT_DEFINED
9 #define SkHRESULT_DEFINED
10
11 #include "SkTypes.h"
12 #ifdef SK_BUILD_FOR_WIN
13
14 #include "../../private/SkLeanWindows.h"
15
16 void SkTraceHR(const char* file, unsigned long line,
17 HRESULT hr, const char* msg);
18
19 #ifdef SK_DEBUG
20 #define SK_TRACEHR(_hr, _msg) SkTraceHR(__FILE__, __LINE__, _hr, _msg)
21 #else
22 #define SK_TRACEHR(_hr, _msg) sk_ignore_unused_variable(_hr)
23 #endif
24
25 #define HR_GENERAL(_ex, _msg, _ret) {\
26 HRESULT _hr = _ex;\
27 if (FAILED(_hr)) {\
28 SK_TRACEHR(_hr, _msg);\
29 return _ret;\
30 }\
31 }
32
33 //@{
34 /**
35 These macros are for reporting HRESULT errors.
36 The expression will be evaluated.
37 If the resulting HRESULT SUCCEEDED then execution will continue normally.
38 If the HRESULT FAILED then the macro will return from the current function.
39 In variants ending with 'M' the given message will be traced when FAILED.
40 The HR variants will return the HRESULT when FAILED.
41 The HRB variants will return false when FAILED.
42 The HRN variants will return NULL when FAILED.
43 The HRV variants will simply return when FAILED.
44 The HRZ variants will return 0 when FAILED.
45 */
46 #define HR(ex) HR_GENERAL(ex, NULL, _hr)
47 #define HRM(ex, msg) HR_GENERAL(ex, msg, _hr)
48
49 #define HRB(ex) HR_GENERAL(ex, NULL, false)
50 #define HRBM(ex, msg) HR_GENERAL(ex, msg, false)
51
52 #define HRN(ex) HR_GENERAL(ex, NULL, NULL)
53 #define HRNM(ex, msg) HR_GENERAL(ex, msg, NULL)
54
55 #define HRV(ex) HR_GENERAL(ex, NULL, )
56 #define HRVM(ex, msg) HR_GENERAL(ex, msg, )
57
58 #define HRZ(ex) HR_GENERAL(ex, NULL, 0)
59 #define HRZM(ex, msg) HR_GENERAL(ex, msg, 0)
60 //@}
61 #endif // SK_BUILD_FOR_WIN
62 #endif // SkHRESULT_DEFINED
OLDNEW
« no previous file with comments | « include/utils/win/SkAutoCoInitialize.h ('k') | include/utils/win/SkIStream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698