From f39c54f71e8e9f053b7efb6e69b1429944badba4 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Tue, 11 Apr 2023 14:47:22 +0700 Subject: Platform guards for ReadOnlySet --- crypto/src/util/collections/ReadOnlySet.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crypto/src/util/collections/ReadOnlySet.cs') diff --git a/crypto/src/util/collections/ReadOnlySet.cs b/crypto/src/util/collections/ReadOnlySet.cs index 36c198f07..d77494847 100644 --- a/crypto/src/util/collections/ReadOnlySet.cs +++ b/crypto/src/util/collections/ReadOnlySet.cs @@ -1,10 +1,15 @@ using System; +using System.Collections; using System.Collections.Generic; namespace Org.BouncyCastle.Utilities.Collections { internal abstract class ReadOnlySet +#if NETCOREAPP1_0_OR_GREATER || NET40_OR_GREATER || NETSTANDARD1_0_OR_GREATER : ISet +#else + : ICollection, IEnumerable, IEnumerable +#endif { System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { @@ -35,6 +40,7 @@ namespace Org.BouncyCastle.Utilities.Collections public abstract bool Overlaps(IEnumerable other); } +#if NETCOREAPP1_0_OR_GREATER || NET40_OR_GREATER || NETSTANDARD1_0_OR_GREATER internal class ReadOnlySetProxy : ReadOnlySet { @@ -58,4 +64,5 @@ namespace Org.BouncyCastle.Utilities.Collections public override bool IsSupersetOf(IEnumerable other) => m_target.IsSupersetOf(other); public override bool Overlaps(IEnumerable other) => m_target.Overlaps(other); } +#endif } -- cgit 1.4.1