From ef26b274e3a3bf96b96ec24cd8b897bff5b21503 Mon Sep 17 00:00:00 2001 From: Pavel Koneski Date: Wed, 4 Dec 2024 14:27:22 -0800 Subject: [PATCH] Define UnsupportedOSPlatformAttribute --- Src/IronPython/SystemRuntimeVersioning.cs | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Src/IronPython/SystemRuntimeVersioning.cs b/Src/IronPython/SystemRuntimeVersioning.cs index d0c1ebe8d..e8c1a7ae5 100644 --- a/Src/IronPython/SystemRuntimeVersioning.cs +++ b/Src/IronPython/SystemRuntimeVersioning.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the Apache 2.0 license. // See the LICENSE file in the project root for more information. +#nullable enable + namespace System.Runtime.Versioning { #if !FEATURE_OSPLATFORMATTRIBUTE internal abstract class OSPlatformAttribute : Attribute { @@ -26,5 +28,27 @@ internal sealed class SupportedOSPlatformAttribute : OSPlatformAttribute { public SupportedOSPlatformAttribute(string platformName) : base(platformName) { } } + + [AttributeUsage(AttributeTargets.Assembly | + AttributeTargets.Class | + AttributeTargets.Constructor | + AttributeTargets.Enum | + AttributeTargets.Event | + AttributeTargets.Field | + AttributeTargets.Method | + AttributeTargets.Module | + AttributeTargets.Property | + AttributeTargets.Struct, + AllowMultiple = true, Inherited = false)] + internal sealed class UnsupportedOSPlatformAttribute : OSPlatformAttribute { + public UnsupportedOSPlatformAttribute(string platformName) : base(platformName) { + } + + public UnsupportedOSPlatformAttribute (string platformName, string? message) : base(platformName) { + Message = message; + } + + public string? Message { get; } + } #endif }