add additional #if-directives
This commit is contained in:
parent
7adc5619d7
commit
508aaa4400
|
@ -290,7 +290,11 @@ namespace BizHawk.Client.Common
|
||||||
_dest = replacement;
|
_dest = replacement;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER
|
||||||
|
public override void Write(ReadOnlySpan<byte> buffer)
|
||||||
|
#else
|
||||||
public void Write(ReadOnlySpan<byte> buffer)
|
public void Write(ReadOnlySpan<byte> buffer)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
var requestedSize = _position + buffer.Length;
|
var requestedSize = _position + buffer.Length;
|
||||||
MaybeResize(requestedSize);
|
MaybeResize(requestedSize);
|
||||||
|
@ -304,7 +308,11 @@ namespace BizHawk.Client.Common
|
||||||
_dest[_position] = value;
|
_dest[_position] = value;
|
||||||
_position = requestedSize;
|
_position = requestedSize;
|
||||||
}
|
}
|
||||||
|
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER
|
||||||
|
public override int Read(Span<byte> buffer) => throw new IOException();
|
||||||
|
#else
|
||||||
public int Read(Span<byte> buffer) => throw new IOException();
|
public int Read(Span<byte> buffer) => throw new IOException();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -443,14 +443,22 @@ namespace BizHawk.Client.Common
|
||||||
public override int Read(byte[] buffer, int offset, int count) => throw new IOException();
|
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 long Seek(long offset, SeekOrigin origin) => throw new IOException();
|
||||||
public override void SetLength(long value) => 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<byte> buffer) => throw new IOException();
|
||||||
|
#else
|
||||||
public int Read(Span<byte> buffer) => throw new IOException();
|
public int Read(Span<byte> buffer) => throw new IOException();
|
||||||
|
#endif
|
||||||
|
|
||||||
public override void Write(byte[] buffer, int offset, int count)
|
public override void Write(byte[] buffer, int offset, int count)
|
||||||
{
|
{
|
||||||
Write(new ReadOnlySpan<byte>(buffer, offset, count));
|
Write(new ReadOnlySpan<byte>(buffer, offset, count));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER
|
||||||
|
public override void Write(ReadOnlySpan<byte> buffer)
|
||||||
|
#else
|
||||||
public void Write(ReadOnlySpan<byte> buffer)
|
public void Write(ReadOnlySpan<byte> buffer)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
long requestedSize = _position + buffer.Length;
|
long requestedSize = _position + buffer.Length;
|
||||||
while (requestedSize > _notifySize)
|
while (requestedSize > _notifySize)
|
||||||
|
@ -526,7 +534,11 @@ namespace BizHawk.Client.Common
|
||||||
return Read(new Span<byte>(buffer, offset, count));
|
return Read(new Span<byte>(buffer, offset, count));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER
|
||||||
|
public override int Read(Span<byte> buffer)
|
||||||
|
#else
|
||||||
public int Read(Span<byte> buffer)
|
public int Read(Span<byte> buffer)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
long n = Math.Min(_size - _position, buffer.Length);
|
long n = Math.Min(_size - _position, buffer.Length);
|
||||||
int ret = (int)n;
|
int ret = (int)n;
|
||||||
|
@ -577,7 +589,11 @@ namespace BizHawk.Client.Common
|
||||||
public override void SetLength(long value) => throw new IOException();
|
public override void SetLength(long value) => throw new IOException();
|
||||||
public override void Write(byte[] buffer, int offset, int count) => 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<byte> buffer) => throw new IOException();
|
||||||
|
#else
|
||||||
public void Write(ReadOnlySpan<byte> buffer) => throw new IOException();
|
public void Write(ReadOnlySpan<byte> buffer) => throw new IOException();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4796,7 +4796,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create pipe and start the async connection wait
|
// Create pipe and start the async connection wait
|
||||||
|
#if NET5_0_OR_GREATER
|
||||||
|
_singleInstanceServer = NamedPipeServerStreamAcl.Create(
|
||||||
|
#else
|
||||||
_singleInstanceServer = new NamedPipeServerStream(
|
_singleInstanceServer = new NamedPipeServerStream(
|
||||||
|
#endif
|
||||||
"pipe-{84125ACB-F570-4458-9748-321F887FE795}",
|
"pipe-{84125ACB-F570-4458-9748-321F887FE795}",
|
||||||
PipeDirection.In,
|
PipeDirection.In,
|
||||||
1,
|
1,
|
||||||
|
|
|
@ -17,10 +17,10 @@ namespace BizHawk.Common.StringExtensions
|
||||||
#if !(NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER)
|
#if !(NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER)
|
||||||
public static bool Contains(this string haystack, char needle)
|
public static bool Contains(this string haystack, char needle)
|
||||||
=> haystack.IndexOf(needle) >= 0;
|
=> haystack.IndexOf(needle) >= 0;
|
||||||
#endif
|
|
||||||
|
|
||||||
public static bool Contains(this string haystack, string needle, StringComparison comparisonType)
|
public static bool Contains(this string haystack, string needle, StringComparison comparisonType)
|
||||||
=> haystack.IndexOf(needle, comparisonType) != -1;
|
=> haystack.IndexOf(needle, comparisonType) != -1;
|
||||||
|
#endif
|
||||||
|
|
||||||
/// <inheritdoc cref="EqualsIgnoreCase"/>
|
/// <inheritdoc cref="EqualsIgnoreCase"/>
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
|
Loading…
Reference in New Issue