Skip to content

Commit

Permalink
Adding netstandard2.0 so we can use this from a MSBuild inline task e…
Browse files Browse the repository at this point in the history
…asier.
  • Loading branch information
wasabii committed Dec 8, 2024
1 parent 4b59fd6 commit 3b7a025
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/IKVM.ByteCode/Buffers/SequenceReader.Search.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NETFRAMEWORK
#if NETFRAMEWORK || NETSTANDARD

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
Expand Down
2 changes: 1 addition & 1 deletion src/IKVM.ByteCode/Buffers/SequenceReader.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NETFRAMEWORK
#if NETFRAMEWORK || NETSTANDARD

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
Expand Down
6 changes: 3 additions & 3 deletions src/IKVM.ByteCode/Buffers/SequenceReaderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static bool TryRead(ref this SequenceReader<byte> reader, out sbyte value
return false;
}

#if NETFRAMEWORK
#if NETFRAMEWORK || NETSTANDARD

/// <summary>
/// Reads an <see cref="Int16"/> as big endian.
Expand Down Expand Up @@ -120,7 +120,7 @@ private static bool TryReadReverseEndianness(ref SequenceReader<byte> reader, ou
return false;
}

#if NETFRAMEWORK
#if NETFRAMEWORK || NETSTANDARD

/// <summary>
/// Reads an <see cref="Int32"/> as big endian.
Expand Down Expand Up @@ -160,7 +160,7 @@ static bool TryReadReverseEndianness(ref SequenceReader<byte> reader, out int va
return false;
}

#if NETFRAMEWORK
#if NETFRAMEWORK || NETSTANDARD

/// <summary>
/// Reads an <see cref="Int64"/> as big endian.
Expand Down
4 changes: 2 additions & 2 deletions src/IKVM.ByteCode/IKVM.ByteCode.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0;net7.0;net8.0;netstandard2.0</TargetFrameworks>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
Expand All @@ -18,7 +18,7 @@
<InternalsVisibleTo Include="IKVM.ByteCode.Tests" />
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net461'))">
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net461')) Or $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'netstandard2.0'))">
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/IKVM.ByteCode/OpCodeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static class OpCodeExtensions
/// <returns></returns>
public static bool IsValid(this OpCode opcode)
{
#if NETFRAMEWORK
#if NETFRAMEWORK || NETSTANDARD
return Enum.IsDefined(typeof(OpCode), opcode);
#else
return Enum.IsDefined<OpCode>(opcode);
Expand Down
2 changes: 1 addition & 1 deletion src/IKVM.ByteCode/Text/EncodingExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace IKVM.ByteCode.Text
static class EncodingExtensions
{

#if NETFRAMEWORK
#if NETFRAMEWORK || NETSTANDARD

public static unsafe string GetString(this System.Text.Encoding self, ReadOnlySpan<byte> bytes)
{
Expand Down
8 changes: 4 additions & 4 deletions src/IKVM.ByteCode/Text/MUTF8Encoding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public override int GetByteCount(char[] chars, int index, int count)
return GetByteCount(chars.AsSpan(index, count));
}

#if NETFRAMEWORK
#if NETFRAMEWORK || NETSTANDARD

public unsafe int GetByteCount(ReadOnlySpan<char> chars)
{
Expand Down Expand Up @@ -113,7 +113,7 @@ public override int GetBytes(char[] chars, int charIndex, int charCount, byte[]
return GetBytes(chars.AsSpan(charIndex, charCount), bytes.AsSpan(byteIndex));
}

#if NETFRAMEWORK
#if NETFRAMEWORK || NETSTANDARD

public unsafe int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes)
{
Expand Down Expand Up @@ -173,7 +173,7 @@ public override unsafe int GetBytes(char* chars, int charCount, byte* bytes, int
return j;
}

#if NETFRAMEWORK
#if NETFRAMEWORK || NETSTANDARD

public unsafe int GetCharCount(ReadOnlySpan<byte> bytes)
{
Expand Down Expand Up @@ -223,7 +223,7 @@ public unsafe override int GetChars(byte[] bytes, int byteIndex, int byteCount,
return GetChars(bytes.AsSpan(byteIndex, byteCount), chars.AsSpan(charIndex));
}

#if NETFRAMEWORK
#if NETFRAMEWORK || NETSTANDARD

/// <inheritdoc />
public unsafe int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars)
Expand Down

0 comments on commit 3b7a025

Please sign in to comment.