Skip to content

Commit

Permalink
Add comIdentical + winrtIdentical functions (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanlabelle authored Aug 19, 2024
1 parent 83ed540 commit 0840d45
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Support/Sources/COM/comIdentical.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public func comIdentical(_ lhs: IUnknown, _ rhs: IUnknown) -> Bool {
guard let lhsIdentityReference = try? lhs._queryInterface(IUnknownProjection.interfaceID) else { return false }
guard let rhsIdentityReference = try? rhs._queryInterface(IUnknownProjection.interfaceID) else { return false }
return lhsIdentityReference.pointer == rhsIdentityReference.pointer
}
5 changes: 5 additions & 0 deletions Support/Sources/WindowsRuntime/winrtIdentical.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import COM

public func winrtIdentical(_ lhs: IInspectable, _ rhs: IInspectable) -> Bool {
comIdentical(lhs, rhs)
}

0 comments on commit 0840d45

Please sign in to comment.