From 22b840c2f18a225aa706b9d3fcce2f7b0f319975 Mon Sep 17 00:00:00 2001 From: Shen-Ta Hsieh Date: Thu, 4 Mar 2021 18:37:22 +0100 Subject: [PATCH] win32/Com: use if with init-statement --- src/win32/Com.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/win32/Com.hxx b/src/win32/Com.hxx index ded264ee2..0c3c400fb 100644 --- a/src/win32/Com.hxx +++ b/src/win32/Com.hxx @@ -29,8 +29,8 @@ class COM { public: COM() { - HRESULT result = CoInitializeEx(nullptr, COINIT_MULTITHREADED); - if (FAILED(result)) { + if (HRESULT result = CoInitializeEx(nullptr, COINIT_MULTITHREADED); + FAILED(result)) { throw FormatHResultError(result, "Unable to initialize COM"); } }