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