Skip to content

Commit 5cd3d2d

Browse files
committed
Fix build on Macos
1 parent 92c615c commit 5cd3d2d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

core/darwin/src/TimeZoneNative.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ internal actual fun currentSystemDefaultZone(): RegionTimeZone {
6464
*/
6565
NSTimeZone.resetSystemTimeZone()
6666
val zone = NSTimeZone.systemTimeZone
67-
val zoneId = zone.name ?: throw IllegalStateException("Failed to get the system timezone")
67+
val zoneId = zone.name
6868
return RegionTimeZone(systemTzdb.rulesForId(zoneId), zoneId)
6969
}

core/native/src/Instant.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ private fun isValidInstantSecond(second: Long) = second >= MIN_SECOND && second
134134

135135
internal fun currentTime(): Instant = memScoped {
136136
val tm = alloc<timespec>()
137-
val error = clock_gettime(CLOCK_REALTIME, tm.ptr)
137+
val error = clock_gettime(CLOCK_REALTIME.convert(), tm.ptr)
138138
check(error == 0) { "Error when reading the system clock: ${strerror(errno)}" }
139139
try {
140140
require(tm.tv_nsec in 0 until NANOS_PER_ONE)

0 commit comments

Comments
 (0)