Skip to content

Commit

Permalink
Merge pull request #1501 from JustArchi/patch-1
Browse files Browse the repository at this point in the history
Fix macOS incompatibilies related to system libraries
  • Loading branch information
yaakov-h authored Feb 3, 2025
2 parents cea197e + d038d5a commit f164e14
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions SteamKit2/SteamKit2/Util/MacHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static class LibC
[SupportedOSPlatform( "macos" )]
static partial class CoreFoundation
{
const string LibraryName = "CoreFoundation.framework/CoreFoundation";
const string LibraryName = "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation";

public enum CFStringEncoding : uint
{
Expand Down Expand Up @@ -114,7 +114,7 @@ public enum CFStringEncoding : uint
[SupportedOSPlatform( "macos" )]
static partial class DiskArbitration
{
const string LibraryName = "DiskArbitration.framework/DiskArbitration";
const string LibraryName = "/System/Library/Frameworks/DiskArbitration.framework/DiskArbitration";
public const string kDADiskDescriptionMediaUUIDKey = "DAMediaUUID";

[LibraryImport( LibraryName )]
Expand All @@ -132,7 +132,7 @@ static partial class DiskArbitration
[SupportedOSPlatform( "macos" )]
static partial class IOKit
{
const string LibraryName = "IOKit.framework/IOKit";
const string LibraryName = "/System/Library/Frameworks/IOKit.framework/IOKit";

public const uint kIOMasterPortDefault = 0;
public const string kIOPlatformSerialNumberKey = "IOPlatformSerialNumber";
Expand Down
9 changes: 9 additions & 0 deletions SteamKit2/Tests/MachineInfoFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ public void MachineInfoIsProcessedInBackground()
HardwareUtils.GetMachineID(provider);
}

[Fact]
public void DefaultProviderIsOperative()
{
var defaultProvider = MachineInfoProvider.GetDefaultProvider();

HardwareUtils.Init(defaultProvider);
HardwareUtils.GetMachineID(defaultProvider);
}

[Fact]
public void ProviderIsNotRetained()
{
Expand Down

0 comments on commit f164e14

Please sign in to comment.