0
0
Fork 0
This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
ryujinx-final/Ryujinx.HLE/Exceptions/InvalidStructLayoutException.cs

15 lines
505 B
C#
Raw Normal View History

using System;
using System.Runtime.CompilerServices;
namespace Ryujinx.HLE.Exceptions
{
public class InvalidStructLayoutException<T> : Exception
{
static readonly Type _structType = typeof(T);
public InvalidStructLayoutException(string message) : base(message) { }
public InvalidStructLayoutException(int expectedSize)
: base($"Type {_structType.Name} has the wrong size. Expected: {expectedSize} bytes, got: {Unsafe.SizeOf<T>()} bytes") { }
}
}