-
Notifications
You must be signed in to change notification settings - Fork 679
Use the new Android overlay in the tests and update some Bionic declarations #3009
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,12 +124,20 @@ private let sysWritev = sysWritev_wrapper | |
#elseif !os(Windows) | ||
private let sysWritev: @convention(c) (Int32, UnsafePointer<iovec>?, CInt) -> CLong = writev | ||
#endif | ||
#if !os(Windows) | ||
#if canImport(Android) | ||
private let sysRecvMsg: @convention(c) (CInt, UnsafeMutablePointer<msghdr>, CInt) -> ssize_t = recvmsg | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These nullability annotations were added with NDK 27 this summer, so adapt these networking APIs for that. |
||
private let sysSendMsg: @convention(c) (CInt, UnsafePointer<msghdr>, CInt) -> ssize_t = sendmsg | ||
#elseif !os(Windows) | ||
private let sysRecvMsg: @convention(c) (CInt, UnsafeMutablePointer<msghdr>?, CInt) -> ssize_t = recvmsg | ||
private let sysSendMsg: @convention(c) (CInt, UnsafePointer<msghdr>?, CInt) -> ssize_t = sendmsg | ||
#endif | ||
private let sysDup: @convention(c) (CInt) -> CInt = dup | ||
#if !os(Windows) | ||
#if canImport(Android) | ||
private let sysGetpeername: | ||
@convention(c) (CInt, UnsafeMutablePointer<sockaddr>, UnsafeMutablePointer<socklen_t>) -> CInt = getpeername | ||
private let sysGetsockname: | ||
@convention(c) (CInt, UnsafeMutablePointer<sockaddr>, UnsafeMutablePointer<socklen_t>) -> CInt = getsockname | ||
#elseif !os(Windows) | ||
private let sysGetpeername: | ||
@convention(c) (CInt, UnsafeMutablePointer<sockaddr>?, UnsafeMutablePointer<socklen_t>?) -> CInt = getpeername | ||
private let sysGetsockname: | ||
|
@@ -141,7 +149,9 @@ private let sysIfNameToIndex: @convention(c) (UnsafePointer<CChar>) -> CUnsigned | |
#else | ||
private let sysIfNameToIndex: @convention(c) (UnsafePointer<CChar>?) -> CUnsignedInt = if_nametoindex | ||
#endif | ||
#if !os(Windows) | ||
#if canImport(Android) | ||
private let sysSocketpair: @convention(c) (CInt, CInt, CInt, UnsafeMutablePointer<CInt>) -> CInt = socketpair | ||
#elseif !os(Windows) | ||
private let sysSocketpair: @convention(c) (CInt, CInt, CInt, UnsafeMutablePointer<CInt>?) -> CInt = socketpair | ||
#endif | ||
|
||
|
@@ -1000,7 +1010,7 @@ internal enum Posix { | |
socketVector: UnsafeMutablePointer<CInt>? | ||
) throws { | ||
_ = try syscall(blocking: false) { | ||
sysSocketpair(domain.rawValue, type.rawValue, protocolSubtype.rawValue, socketVector) | ||
sysSocketpair(domain.rawValue, type.rawValue, protocolSubtype.rawValue, socketVector!) | ||
} | ||
} | ||
#endif | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,8 +22,8 @@ import XCTest | |
import Darwin | ||
#elseif canImport(Glibc) | ||
import Glibc | ||
#elseif canImport(Bionic) | ||
import Bionic | ||
#elseif canImport(Android) | ||
import Android | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed a couple months ago, the compiler started requiring different imports after the Foundation rewrite this summer. |
||
#else | ||
#error("The Concurrency helpers test module was unable to identify your C library.") | ||
#endif | ||
|
Uh oh!
There was an error while loading. Please reload this page.