Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Tmds.DBus.Protocol/PlatformDetection.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
namespace Tmds.DBus.Protocol;
#if NET6_0_OR_GREATER
using System.Runtime.Versioning;
#endif

static class PlatformDetection
{
#if NET6_0_OR_GREATER
[SupportedOSPlatformGuard("windows")]
#endif
public static bool IsWindows() =>
#if NET6_0_OR_GREATER
// IsWindows is marked with the NonVersionable attribute.
Expand Down
4 changes: 2 additions & 2 deletions src/Tmds.DBus/Address.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private static string GetSessionBusAddressFromX11()
}

#if NET6_0_OR_GREATER
[SupportedOSPlatform("Windows")]
[SupportedOSPlatform("windows")]
#endif
private static string GetSessionBusAddressFromSharedMemory()
{
Expand All @@ -156,7 +156,7 @@ private static string GetSessionBusAddressFromSharedMemory()
}

#if NET6_0_OR_GREATER
[SupportedOSPlatform("Windows")]
[SupportedOSPlatform("windows")]
#endif
private static string ReadSharedMemoryString(string id, long maxlen = -1)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Tmds.DBus/Environment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal static class Environment
public static readonly EndianFlag NativeEndianness;

#if NET6_0_OR_GREATER
[SupportedOSPlatformGuard("Windows")]
[SupportedOSPlatformGuard("windows")]
#endif
public static readonly bool IsWindows;

Expand Down