[watchOS][tvOS] Add Platform.TVOS and Platform.WATCHOS
This commit is contained in:
committed by
Sergey Bogolepov
parent
5cf8438747
commit
d2a213ffca
@@ -71,7 +71,14 @@ fun run() {
|
||||
}
|
||||
|
||||
// hashCode (directly):
|
||||
if (foo.hashCode() == foo.hash().let { it.toInt() xor (it shr 32).toInt() }) {
|
||||
// hash() returns value of NSUInteger type.
|
||||
val hash = when (Platform.osFamily) {
|
||||
// `typedef unsigned int NSInteger` on watchOS.
|
||||
OsFamily.WATCHOS -> foo.hash().toInt()
|
||||
// `typedef unsigned long NSUInteger` on iOS, macOS, tvOS.
|
||||
else -> foo.hash().let { it.toInt() xor (it shr 32).toInt() }
|
||||
}
|
||||
if (foo.hashCode() == hash) {
|
||||
// toString (virtually):
|
||||
if (Platform.memoryModel == MemoryModel.STRICT)
|
||||
println(map.keys.map { it.toString() }.min() == foo.description())
|
||||
|
||||
Reference in New Issue
Block a user