2020-04-02 17:10:02 -07:00
|
|
|
using System;
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
|
|
|
|
namespace Ryujinx.HLE.Exceptions
|
|
|
|
{
|
|
|
|
public class InvalidStructLayoutException<T> : Exception
|
|
|
|
{
|
|
|
|
static readonly Type _structType = typeof(T);
|
|
|
|
|
2021-09-14 16:24:49 -07:00
|
|
|
public InvalidStructLayoutException(string message) : base(message) { }
|
2020-04-02 17:10:02 -07:00
|
|
|
|
2021-09-14 16:24:49 -07:00
|
|
|
public InvalidStructLayoutException(int expectedSize)
|
|
|
|
: base($"Type {_structType.Name} has the wrong size. Expected: {expectedSize} bytes, got: {Unsafe.SizeOf<T>()} bytes") { }
|
2020-04-02 17:10:02 -07:00
|
|
|
}
|
|
|
|
}
|