diff --git a/src/Core/Core.csproj b/src/Core/Core.csproj index 7364df3feb..8fca8e74a5 100644 --- a/src/Core/Core.csproj +++ b/src/Core/Core.csproj @@ -8,7 +8,7 @@ Reko.Core Reko.Core Library - net6.0 + net6.0;net8.0 false Debug;Release True diff --git a/src/Core/IO/SpanStream.cs b/src/Core/IO/SpanStream.cs index 5c16df3ca9..1f5ab0d7fd 100644 --- a/src/Core/IO/SpanStream.cs +++ b/src/Core/IO/SpanStream.cs @@ -271,8 +271,12 @@ public override int Read(byte[] buffer, int offset, int count) { public unsafe void Write(T value) where T : unmanaged { var start = Memory.Span.Slice(pos, sizeof(T)); +#if NET6_0 MemoryMarshal.Write(start, ref value); - pos += sizeof(T); +#else + MemoryMarshal.Write(start, in value); +#endif + pos += sizeof(T); } public unsafe void WriteAt(long offset, T value) where T : unmanaged { diff --git a/src/Decompiler/Decompiler.csproj b/src/Decompiler/Decompiler.csproj index d17d222880..8f155dad38 100644 --- a/src/Decompiler/Decompiler.csproj +++ b/src/Decompiler/Decompiler.csproj @@ -5,7 +5,7 @@ --> - net6.0 + net6.0;net8.0 Reko.Decompiler Reko false