@@ -22,6 +22,7 @@ internal expect fun offset_at_datetime(zone: kotlinx.datetime.TZID /* = kotlin.U
22
22
internal expect fun at_start_of_day (zone : kotlinx.datetime.TZID /* = kotlin.ULong */ , epoch_sec : platform.posix.int64_t /* = kotlin.Long */ ): kotlin.Long
23
23
internal expect fun offset_at_instant (zone : kotlinx.datetime.TZID /* = kotlin.ULong */ , epoch_sec : platform.posix.int64_t /* = kotlin.Long */ ): kotlin.Int
24
24
internal expect fun timezone_by_name (zone_name : kotlin.String? ): kotlinx.datetime.TZID /* = kotlin.ULong */
25
+ internal expect fun current_time (sec : kotlinx.cinterop.CValuesRef <platform.posix.int64_tVar /* = kotlinx.cinterop.LongVarOf<kotlin.Long> */ >? , nano : kotlinx.cinterop.CValuesRef <platform.posix.int32_tVar>? ): kotlin.Boolean
25
26
26
27
public actual open class TimeZone internal constructor(private val tzid : TZID , actual val id : String ) {
27
28
@@ -92,7 +93,7 @@ public actual open class TimeZone internal constructor(private val tzid: TZID, a
92
93
93
94
internal open fun offsetAtImpl (instant : Instant ): ZoneOffset {
94
95
val offset = offset_at_instant(tzid, instant.epochSeconds)
95
- if (offset == INT_MAX ) {
96
+ if (offset == Int . MAX_VALUE ) {
96
97
throw RuntimeException (" Unable to acquire the offset at instant $instant for zone $this " )
97
98
}
98
99
return ZoneOffset .ofSeconds(offset)
@@ -113,9 +114,9 @@ public actual open class TimeZone internal constructor(private val tzid: TZID, a
113
114
internal open fun LocalDateTime.atZone (preferred : ZoneOffset ? = null): ZonedDateTime = memScoped {
114
115
val epochSeconds = toEpochSecond(ZoneOffset .UTC )
115
116
val offset = alloc<IntVar >()
116
- offset.value = preferred?.totalSeconds ? : INT_MAX
117
+ offset.value = preferred?.totalSeconds ? : Int . MAX_VALUE
117
118
val transitionDuration = offset_at_datetime(tzid, epochSeconds, offset.ptr)
118
- if (offset.value == INT_MAX ) {
119
+ if (offset.value == Int . MAX_VALUE ) {
119
120
throw RuntimeException (" Unable to acquire the offset at ${this @atZone} for zone ${this @TimeZone} " )
120
121
}
121
122
val dateTime = try {
0 commit comments