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