aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/Exceptions/InvalidStructLayoutException.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.HLE/Exceptions/InvalidStructLayoutException.cs')
-rw-r--r--src/Ryujinx.HLE/Exceptions/InvalidStructLayoutException.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Ryujinx.HLE/Exceptions/InvalidStructLayoutException.cs b/src/Ryujinx.HLE/Exceptions/InvalidStructLayoutException.cs
new file mode 100644
index 00000000..2f03d13a
--- /dev/null
+++ b/src/Ryujinx.HLE/Exceptions/InvalidStructLayoutException.cs
@@ -0,0 +1,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") { }
+ }
+} \ No newline at end of file