-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add comIdentical + winrtIdentical functions (#240)
- Loading branch information
1 parent
83ed540
commit 0840d45
Showing
2 changed files
with
10 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |