aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/Exceptions/InvalidStructLayoutException.cs
blob: 6852dcefe046b2ea07060f906a3d9d234e158929 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
using System;
using System.Runtime.CompilerServices;

namespace Ryujinx.HLE.Exceptions
{
    public class InvalidStructLayoutException<T> : Exception
    {
        static readonly Type _structType = typeof(T);

        public InvalidStructLayoutException(string message) : base(message) { }

        public InvalidStructLayoutException(int expectedSize)
            : base($"Type {_structType.Name} has the wrong size. Expected: {expectedSize} bytes, got: {Unsafe.SizeOf<T>()} bytes") { }
    }
}