diff --git a/src/dawn_native/d3d12/DeviceD3D12.cpp b/src/dawn_native/d3d12/DeviceD3D12.cpp index 2f535ee6ec..4c6eb3bbad 100644 --- a/src/dawn_native/d3d12/DeviceD3D12.cpp +++ b/src/dawn_native/d3d12/DeviceD3D12.cpp @@ -40,10 +40,6 @@ namespace dawn_native { namespace d3d12 { - void ASSERT_SUCCESS(HRESULT hr) { - ASSERT(SUCCEEDED(hr)); - } - Device::Device(Adapter* adapter, const DeviceDescriptor* descriptor) : DeviceBase(adapter, descriptor) { if (descriptor != nullptr) { diff --git a/src/dawn_native/d3d12/DeviceD3D12.h b/src/dawn_native/d3d12/DeviceD3D12.h index e5a373480c..a856d10ada 100644 --- a/src/dawn_native/d3d12/DeviceD3D12.h +++ b/src/dawn_native/d3d12/DeviceD3D12.h @@ -33,7 +33,11 @@ namespace dawn_native { namespace d3d12 { class PlatformFunctions; class ResourceAllocator; - void ASSERT_SUCCESS(HRESULT hr); +#define ASSERT_SUCCESS(hr) \ + { \ + HRESULT succeeded = hr; \ + ASSERT(SUCCEEDED(succeeded)); \ + } // Definition of backend types class Device : public DeviceBase {