From cee712105850ac3385cd0091a923438167433f9f Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Sat, 8 Apr 2023 01:22:00 +0200 Subject: Move solution and projects to src --- .../Exceptions/InvalidStructLayoutException.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/Ryujinx.HLE/Exceptions/InvalidStructLayoutException.cs (limited to 'src/Ryujinx.HLE/Exceptions/InvalidStructLayoutException.cs') 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 : 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()} bytes") { } + } +} \ No newline at end of file -- cgit v1.2.3