Skip to content

Commit

Permalink
Upgrade to Scala Native 0.5.0-RC2 (#141)
Browse files Browse the repository at this point in the history
* Upgrade to Scala Native 0.5.0-RC2

* Upgrade Scala.js to 1.16.0 and Scala Native to 0.5.0-RC3
  • Loading branch information
ekrich authored Apr 8, 2024
1 parent 43b2be0 commit 09b0efa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resolvers ++= Resolver.sonatypeOssRepos("snapshots")
// versions
val crossVer = "1.3.2"
val scalaJSVersion = "1.16.0"
val scalaNativeVersion = "0.5.0-RC1"
val scalaNativeVersion = "0.5.0-RC3"

// Scala.js support
addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package java.time

import scala.scalanative.unsafe.extern
import scala.scalanative.unsafe.CLongLong

@extern object UseFFI {
def scalanative_time_zone_offset(): CLongLong = extern
}

private[time] object PlatformSpecific extends PlatformCommon {

def localDate(): LocalDate = {
Expand All @@ -20,7 +27,7 @@ private[time] object PlatformSpecific extends PlatformCommon {
val now = Instant.now()
val epochSeconds = now.getEpochSecond()
// UTC to local time - private api
val offset = scalanative.runtime.time.scalanative_time_zone_offset()
val offset = UseFFI.scalanative_time_zone_offset()
val offsetSeconds = epochSeconds + offset
val nanos = now.getNano()
// sec/yr, sec/day
Expand Down

0 comments on commit 09b0efa

Please sign in to comment.