diff --git a/io/src/main/scala/sbt/internal/io/Milli.scala b/io/src/main/scala/sbt/internal/io/Milli.scala index 39e043cd..3603ec29 100644 --- a/io/src/main/scala/sbt/internal/io/Milli.scala +++ b/io/src/main/scala/sbt/internal/io/Milli.scala @@ -75,15 +75,20 @@ private abstract class MilliNative[Native] extends Milli { protected def toNative(mtime: Long): Native // convert milliseconds to native time } -private trait PosixBase { +/** + * FFI for standard C library. + */ +private sealed trait PosixBase extends Library { + /** http://www.cplusplus.com/reference/cstring/strerror/ */ def strerror(errnum: Int): String } + private abstract class MilliPosixBase[Interface <: PosixBase: ClassTag, Native] extends MilliNative[Native] { private val options = scala.collection.Map[String, Object]().asJava private final val ENOENT = 2 protected val libc: Interface = - (JNANative.loadLibrary( + (JNANative.load( Platform.C_LIBRARY_NAME, classTag[Interface].runtimeClass.asInstanceOf[Class[Interface]], options diff --git a/project/Dependencies.scala b/project/Dependencies.scala index bc24630f..7f930c32 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -9,8 +9,8 @@ object Dependencies { val scalaCheck = "org.scalacheck" %% "scalacheck" % "1.14.0" val scalatest = "org.scalatest" %% "scalatest" % "3.0.8" - val jna = "net.java.dev.jna" % "jna" % "4.5.0" - val jnaPlatform = "net.java.dev.jna" % "jna-platform" % "4.5.0" + val jna = "net.java.dev.jna" % "jna" % "5.5.0" + val jnaPlatform = "net.java.dev.jna" % "jna-platform" % "5.5.0" val swovalFiles = "com.swoval" % "file-tree-views" % "2.1.3" def nightlyVersion: Option[String] = sys.props.get("sbt.build.version") }