2020-04-03 00:10:02 +00: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 23:24:49 +00:00
|
|
|
public InvalidStructLayoutException(string message) : base(message) { }
|
2020-04-03 00:10:02 +00:00
|
|
|
|
2021-09-14 23:24:49 +00:00
|
|
|
public InvalidStructLayoutException(int expectedSize)
|
|
|
|
: base($"Type {_structType.Name} has the wrong size. Expected: {expectedSize} bytes, got: {Unsafe.SizeOf<T>()} bytes") { }
|
2020-04-03 00:10:02 +00:00
|
|
|
}
|
|
|
|
}
|