Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work around a type checking error when using the Static Linux SDK #2898

Merged
merged 1 commit into from
Sep 24, 2024
Merged
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
11 changes: 10 additions & 1 deletion Sources/NIOPosix/PosixSingletons+ConcurrencyTakeOver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ extension NIOSingletons {
let concurrencyEnqueueGlobalHookPtr = dlsym(
dlopen(nil, RTLD_NOW),
"swift_task_enqueueGlobal_hook"
)?.assumingMemoryBound(to: UnsafeRawPointer?.AtomicRepresentation.self)
)?.assumingMemoryBound(to: UnsafeRawPointer?.AtomicRep.self)
guard let concurrencyEnqueueGlobalHookPtr = concurrencyEnqueueGlobalHookPtr else {
return false
}
Expand Down Expand Up @@ -126,3 +126,12 @@ extension NIOSingletons {
#endif
}
}

// Workaround for https://github.com/apple/swift-nio/issues/2893
extension Optional
where
Wrapped: AtomicOptionalWrappable,
Wrapped.AtomicRepresentation.Value == Wrapped
{
typealias AtomicRep = Wrapped.AtomicOptionalRepresentation
}
Loading