Code refactoring, moved TerraFX dep to .Graphics

このコミットが含まれているのは:
Sergio Pedri committed 2020-11-25 01:32:40 +01:00
1 親 aa5c76253f
コミット 3f5460e0ca
5ファイル変更
+4 -1

検索条件に一致するファイルはありません

+29
ファイルの表示
@@ -0,0 +1,29 @@
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using Microsoft.Toolkit.Diagnostics;
using HRESULT = System.Int32;
namespace ComputeSharp.Core.Extensions
{
/// <summary>
/// Helper methods to efficiently throw exceptions.
/// </summary>
[DebuggerStepThrough]
internal static class HResultExtensions
{
/// <summary>
/// Throws a <see cref="Win32Exception"/> if <paramref name="result"/> represents an error.
/// </summary>
/// <param name="result">The input <see cref="HRESULT"/> to check.</param>
/// <exception cref="Win32Exception">Thrown if <paramref name="result"/> represents an error.</exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void Assert(this HRESULT result)
{
if (result < 0)
{
ThrowHelper.ThrowWin32Exception(result);
}
}
}
}