mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-22 20:47:28 +01:00
Fix PlatformIdentifier not having a compiler guard
This commit is contained in:
@@ -295,7 +295,6 @@ namespace Tgstation.Server.Host.Core
|
||||
services.AddSingleton<IPasswordHasher<Models.User>, PasswordHasher<Models.User>>();
|
||||
|
||||
// configure platform specific services
|
||||
#pragma warning disable CA1416 // Validate platform compatibility
|
||||
if (postSetupServices.PlatformIdentifier.IsWindows)
|
||||
{
|
||||
AddWatchdog<WindowsWatchdogFactory>(services, postSetupServices);
|
||||
@@ -325,7 +324,6 @@ namespace Tgstation.Server.Host.Core
|
||||
|
||||
services.AddSingleton<IHostedService, PosixSignalHandler>();
|
||||
}
|
||||
#pragma warning restore CA1416 // Validate platform compatibility
|
||||
|
||||
// configure component/misc services
|
||||
services.AddScoped<IPortAllocator, PortAllocator>();
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Tgstation.Server.Host.System
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
namespace Tgstation.Server.Host.System
|
||||
{
|
||||
/// <summary>
|
||||
/// For identifying the current platform.
|
||||
@@ -8,6 +10,7 @@
|
||||
/// <summary>
|
||||
/// If the current platform is a Windows platform.
|
||||
/// </summary>
|
||||
[SupportedOSPlatformGuard("windows")]
|
||||
bool IsWindows { get; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
namespace Tgstation.Server.Host.System
|
||||
{
|
||||
@@ -6,6 +7,7 @@ namespace Tgstation.Server.Host.System
|
||||
sealed class PlatformIdentifier : IPlatformIdentifier
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[SupportedOSPlatformGuard("windows")]
|
||||
public bool IsWindows { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
Reference in New Issue
Block a user