diff --git a/src/BizHawk.Client.Common/rewind/ZeldaWinder.cs b/src/BizHawk.Client.Common/rewind/ZeldaWinder.cs index ebe35d80b8..80d86fe565 100644 --- a/src/BizHawk.Client.Common/rewind/ZeldaWinder.cs +++ b/src/BizHawk.Client.Common/rewind/ZeldaWinder.cs @@ -290,7 +290,11 @@ namespace BizHawk.Client.Common _dest = replacement; } } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public override void Write(ReadOnlySpan buffer) +#else public void Write(ReadOnlySpan buffer) +#endif { var requestedSize = _position + buffer.Length; MaybeResize(requestedSize); @@ -304,7 +308,11 @@ namespace BizHawk.Client.Common _dest[_position] = value; _position = requestedSize; } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public override int Read(Span buffer) => throw new IOException(); +#else public int Read(Span buffer) => throw new IOException(); +#endif } } } diff --git a/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs b/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs index 5843b8e3c2..97214aa761 100644 --- a/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs +++ b/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs @@ -443,14 +443,22 @@ namespace BizHawk.Client.Common public override int Read(byte[] buffer, int offset, int count) => throw new IOException(); public override long Seek(long offset, SeekOrigin origin) => throw new IOException(); public override void SetLength(long value) => throw new IOException(); +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public override int Read(Span buffer) => throw new IOException(); +#else public int Read(Span buffer) => throw new IOException(); +#endif public override void Write(byte[] buffer, int offset, int count) { Write(new ReadOnlySpan(buffer, offset, count)); } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public override void Write(ReadOnlySpan buffer) +#else public void Write(ReadOnlySpan buffer) +#endif { long requestedSize = _position + buffer.Length; while (requestedSize > _notifySize) @@ -526,7 +534,11 @@ namespace BizHawk.Client.Common return Read(new Span(buffer, offset, count)); } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public override int Read(Span buffer) +#else public int Read(Span buffer) +#endif { long n = Math.Min(_size - _position, buffer.Length); int ret = (int)n; @@ -577,7 +589,11 @@ namespace BizHawk.Client.Common public override void SetLength(long value) => throw new IOException(); public override void Write(byte[] buffer, int offset, int count) => throw new IOException(); +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public override void Write(ReadOnlySpan buffer) => throw new IOException(); +#else public void Write(ReadOnlySpan buffer) => throw new IOException(); +#endif } } } diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index 1b39d292ba..bea63c12f3 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -4796,7 +4796,11 @@ namespace BizHawk.Client.EmuHawk } // Create pipe and start the async connection wait +#if NET5_0_OR_GREATER + _singleInstanceServer = NamedPipeServerStreamAcl.Create( +#else _singleInstanceServer = new NamedPipeServerStream( +#endif "pipe-{84125ACB-F570-4458-9748-321F887FE795}", PipeDirection.In, 1, diff --git a/src/BizHawk.Common/Extensions/StringExtensions.cs b/src/BizHawk.Common/Extensions/StringExtensions.cs index 34a39cb9fe..05b87ecb32 100644 --- a/src/BizHawk.Common/Extensions/StringExtensions.cs +++ b/src/BizHawk.Common/Extensions/StringExtensions.cs @@ -17,10 +17,10 @@ namespace BizHawk.Common.StringExtensions #if !(NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER) public static bool Contains(this string haystack, char needle) => haystack.IndexOf(needle) >= 0; -#endif public static bool Contains(this string haystack, string needle, StringComparison comparisonType) => haystack.IndexOf(needle, comparisonType) != -1; +#endif /// [MethodImpl(MethodImplOptions.AggressiveInlining)]