From cc0b46205f0bf0fb663eabaf8fe74e61883bce60 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sun, 22 Oct 2023 14:28:04 -0400 Subject: [PATCH] Fix warnings with OS restricted classes --- .../Components/Deployment/SymlinkDmbProvider.cs | 4 +++- .../Components/Watchdog/PosixWatchdog.cs | 1 + .../Components/Watchdog/PosixWatchdogFactory.cs | 2 ++ .../Components/Watchdog/WindowsWatchdog.cs | 4 +++- .../Components/Watchdog/WindowsWatchdogFactory.cs | 2 ++ 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Tgstation.Server.Host/Components/Deployment/SymlinkDmbProvider.cs b/src/Tgstation.Server.Host/Components/Deployment/SymlinkDmbProvider.cs index 2edc58d37e..0054e7fa4b 100644 --- a/src/Tgstation.Server.Host/Components/Deployment/SymlinkDmbProvider.cs +++ b/src/Tgstation.Server.Host/Components/Deployment/SymlinkDmbProvider.cs @@ -1,4 +1,5 @@ -using System.Threading; +using System.Runtime.Versioning; +using System.Threading; using System.Threading.Tasks; using Tgstation.Server.Host.IO; @@ -8,6 +9,7 @@ namespace Tgstation.Server.Host.Components.Deployment /// /// A that uses symlinks. /// + [SupportedOSPlatform("windows")] sealed class SymlinkDmbProvider : SwappableDmbProvider { /// diff --git a/src/Tgstation.Server.Host/Components/Watchdog/PosixWatchdog.cs b/src/Tgstation.Server.Host/Components/Watchdog/PosixWatchdog.cs index 2fb5ad1d54..818dea9d7c 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/PosixWatchdog.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/PosixWatchdog.cs @@ -22,6 +22,7 @@ namespace Tgstation.Server.Host.Components.Watchdog /// /// A variant of the that works on POSIX systems. /// + [UnsupportedOSPlatform("windows")] sealed class PosixWatchdog : AdvancedWatchdog { /// diff --git a/src/Tgstation.Server.Host/Components/Watchdog/PosixWatchdogFactory.cs b/src/Tgstation.Server.Host/Components/Watchdog/PosixWatchdogFactory.cs index 64c8672262..1d0d140bc0 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/PosixWatchdogFactory.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/PosixWatchdogFactory.cs @@ -1,4 +1,5 @@ using System; +using System.Runtime.Versioning; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; @@ -20,6 +21,7 @@ namespace Tgstation.Server.Host.Components.Watchdog /// /// for creating s. /// + [UnsupportedOSPlatform("windows")] sealed class PosixWatchdogFactory : WindowsWatchdogFactory { /// diff --git a/src/Tgstation.Server.Host/Components/Watchdog/WindowsWatchdog.cs b/src/Tgstation.Server.Host/Components/Watchdog/WindowsWatchdog.cs index 05c1f10088..8ff6bf3362 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/WindowsWatchdog.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/WindowsWatchdog.cs @@ -1,4 +1,5 @@ -using System.Threading; +using System.Runtime.Versioning; +using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; @@ -19,6 +20,7 @@ namespace Tgstation.Server.Host.Components.Watchdog /// /// A variant of the that works on Windows systems. /// + [SupportedOSPlatform("windows")] sealed class WindowsWatchdog : AdvancedWatchdog { /// diff --git a/src/Tgstation.Server.Host/Components/Watchdog/WindowsWatchdogFactory.cs b/src/Tgstation.Server.Host/Components/Watchdog/WindowsWatchdogFactory.cs index 89ed6b145d..0888294aa4 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/WindowsWatchdogFactory.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/WindowsWatchdogFactory.cs @@ -1,4 +1,5 @@ using System; +using System.Runtime.Versioning; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; @@ -20,6 +21,7 @@ namespace Tgstation.Server.Host.Components.Watchdog /// /// for creating s. /// + [SupportedOSPlatform("windows")] class WindowsWatchdogFactory : WatchdogFactory { ///