Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Sources/ConnectionPoolModule/NIOLock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import Darwin
import ucrt
import WinSDK
#elseif canImport(Glibc)
import Glibc
@preconcurrency import Glibc
#elseif canImport(Musl)
import Musl
@preconcurrency import Musl
#elseif canImport(Bionic)
import Bionic
@preconcurrency import Bionic
#elseif canImport(WASILibc)
import WASILibc
@preconcurrency import WASILibc
#if canImport(wasi_pthread)
import wasi_pthread
#endif
Expand Down
15 changes: 13 additions & 2 deletions Sources/ConnectionPoolModule/PoolStateMachine.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
#if canImport(Darwin)
import Darwin
#elseif os(Windows)
import ucrt
Copy link
Contributor Author

@MahdiBM MahdiBM Dec 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice no WinSDK import unlike in the NIOLock file. I don't think it's needed but I haven't checked in a real environment or in CI.

Right now I'm setting up Android CI in swift-dns (swift-dns/swift-dns#99).
Later when I go for Windows CI set up (swift-dns/swift-dns#96) I'll have a proper result about the Windows compatibility and I can come back with any changes that might be needed.

Copy link
Contributor Author

@MahdiBM MahdiBM Dec 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole reason we need this is a pow call in this file.

Copy link
Contributor Author

@MahdiBM MahdiBM Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I can confirm ucrt solves Windows' problem.
Notice no mention of pow anymore in the failures in https://github.com/swift-dns/swift-dns/actions/runs/20466245614/job/58810637612?pr=96. Last CIs were complaining about pow() on Windows before I apply this PR's changes.

#elseif canImport(Glibc)
import Glibc
@preconcurrency import Glibc
#elseif canImport(Musl)
import Musl
@preconcurrency import Musl
#elseif canImport(Bionic)
@preconcurrency import Bionic
#elseif canImport(WASILibc)
@preconcurrency import WASILibc
#if canImport(wasi_pthread)
import wasi_pthread
#endif
#else
#error("The PoolStateMachine module was unable to identify your C library.")
#endif

@usableFromInline
Expand Down