InvalidStructLayoutException.cs 504 B

123456789101112131415
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. namespace Ryujinx.HLE.Exceptions
  4. {
  5. public class InvalidStructLayoutException<T> : Exception
  6. {
  7. static readonly Type _structType = typeof(T);
  8. public InvalidStructLayoutException(string message) : base(message) {}
  9. public InvalidStructLayoutException(int expectedSize) :
  10. base($"Type {_structType.Name} has the wrong size. Expected: {expectedSize} bytes, Got: {Unsafe.SizeOf<T>()} bytes") {}
  11. }
  12. }