Skip to content

Commit 7b43e80

Browse files
committed
Scala Native 0.5.x
1 parent 2af53bc commit 7b43e80

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

build.sbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
val scala3 = "3.1.1"
2-
val scala213 = "2.13.4"
1+
val scala3 = "3.3.3"
2+
val scala213 = "2.13.14"
33
val scala212 = "2.12.13"
44
val scala211 = "2.11.12"
55

@@ -39,7 +39,7 @@ lazy val commonSettings = Seq(
3939
"-Xfatal-warnings",
4040
// "-Wunused:imports"
4141
),
42-
libraryDependencies += "com.lihaoyi" %%% "utest" % "0.7.11" % Test,
42+
libraryDependencies += "com.lihaoyi" %%% "utest" % "0.8.3" % Test,
4343
testFrameworks += new TestFramework("utest.runner.Framework"),
4444
)
4545

core/src/main/scala/scala/scalanative/loop/Eventloop.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ import scala.scalanative.unsafe._
33
import scala.scalanative.runtime._
44
import scala.scalanative.runtime.Intrinsics._
55
import scala.collection.mutable
6+
import scala.scalanative.concurrent.NativeExecutionContext
67

78
object EventLoop {
89
import LibUV._, LibUVConstants._
910

1011
val loop: LibUV.Loop = uv_default_loop()
1112

1213
// Schedule loop execution after main ends
13-
scalanative.runtime.ExecutionContext.global.execute(
14+
scalanative.concurrent.NativeExecutionContext.queue.execute(
1415
new Runnable {
1516
def run(): Unit = EventLoop.run()
1617
}
@@ -19,7 +20,7 @@ object EventLoop {
1920
// Reference to the private queue of scala.scalanative.runtime.ExecutionContext
2021
private val queue: mutable.ListBuffer[Runnable] = {
2122
val executionContextPtr =
22-
fromRawPtr[Byte](castObjectToRawPtr(ExecutionContext))
23+
fromRawPtr[Byte](castObjectToRawPtr(NativeExecutionContext))
2324
val queuePtr = !((executionContextPtr + 8).asInstanceOf[Ptr[Ptr[Byte]]])
2425
castRawPtrToObject(toRawPtr(queuePtr))
2526
.asInstanceOf[mutable.ListBuffer[Runnable]]
@@ -33,7 +34,7 @@ object EventLoop {
3334
runnable.run()
3435
} catch {
3536
case t: Throwable =>
36-
ExecutionContext.global.reportFailure(t)
37+
NativeExecutionContext.queue.reportFailure(t)
3738
}
3839
uv_run(loop, UV_RUN_NOWAIT)
3940
}

core/src/test/scala/scala/scalanative/loop/PollTests.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ object PollTests extends LoopTestSuite {
3232
throw new Exception("Poll result != 0")
3333
}
3434
val buf = stackalloc[Byte]()
35-
val bytesRead = read(r, buf, 1L.toULong)
35+
val bytesRead = read(r, buf, 1L.toCSize)
3636
assert(bytesRead == 1)
3737
assert(buf(0) == byte)
3838
promise.success(())
3939
poll.stop()
4040
}
4141
val buf = stackalloc[Byte]()
4242
buf(0) = byte
43-
val bytesWrote = write(w, buf, 1L.toULong)
43+
val bytesWrote = write(w, buf, 1L.toCSize)
4444
assert(bytesWrote == 1)
4545
promise.future
4646
}

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.6.2
1+
sbt.version=1.10.0

project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.4")
1+
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.1")
22
addSbtPlugin("com.eed3si9n" % "sbt-dirty-money" % "0.2.0")
33
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1")
44
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.4")

0 commit comments

Comments
 (0)