aboutsummaryrefslogtreecommitdiff
path: root/dxcommon/include
diff options
context:
space:
mode:
authorMarc Sunet <marc.sunet@amd.com>2025-11-18 18:47:12 -0800
committerMarc Sunet <marc.sunet@amd.com>2025-11-18 18:47:12 -0800
commited86aad6d36294e219bc7ffa1f14d2e39fad7ade (patch)
treeba53e2b21091de7f056868a0b44d6e39a098dddf /dxcommon/include
parentfba8184491e0b7ae6fab7ac01b4600d230dc4569 (diff)
Tidy
Diffstat (limited to 'dxcommon/include')
-rw-r--r--dxcommon/include/dxcommon.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/dxcommon/include/dxcommon.h b/dxcommon/include/dxcommon.h
index 0270629..e04f8e9 100644
--- a/dxcommon/include/dxcommon.h
+++ b/dxcommon/include/dxcommon.h
@@ -10,9 +10,10 @@ namespace dx {
10 10
11using Microsoft::WRL::ComPtr; 11using Microsoft::WRL::ComPtr;
12 12
13class exception : public std::exception { 13class exception : public std::exception
14{
14public: 15public:
15 exception() noexcept {} 16 exception() noexcept = default;
16 17
17 exception(HRESULT result, const char* file, int line) noexcept 18 exception(HRESULT result, const char* file, int line) noexcept
18 { 19 {
@@ -25,7 +26,7 @@ public:
25 sprintf_s(m_error, sizeof(m_error), "%s:%d %s", file, line, error); 26 sprintf_s(m_error, sizeof(m_error), "%s:%d %s", file, line, error);
26 } 27 }
27 28
28 const char* what() const noexcept 29 [[nodiscard]] const char* what() const noexcept final
29 { 30 {
30 return m_error; 31 return m_error;
31 } 32 }
@@ -36,8 +37,10 @@ private:
36 37
37#define THROW(error) throw exception(error, __FILE__, __LINE__) 38#define THROW(error) throw exception(error, __FILE__, __LINE__)
38 39
39#define ThrowIfFailed(result) {\ 40#define ThrowIfFailed(result) \
40 if (result != S_OK) {\ 41{\
42 if (result != S_OK) \
43 {\
41 THROW(result);\ 44 THROW(result);\
42 }\ 45 }\
43} 46}