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