Skip to content

Commit 6713533

Browse files
Add support to remaining android targets
For armv7-linux-androideabi and i686-linux-android.
1 parent 5bdcbf0 commit 6713533

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
strategy:
5757
fail-fast: false
5858
matrix:
59-
target: ["aarch64-apple-ios", "aarch64-linux-android", "x86_64-apple-darwin", "x86_64-unknown-fuchsia", "x86_64-pc-windows-msvc", "x86_64-pc-solaris", "x86_64-unknown-freebsd", "x86_64-unknown-illumos", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-unknown-netbsd", "x86_64-unknown-redox"]
59+
target: ["aarch64-apple-ios", "aarch64-linux-android", "x86_64-apple-darwin", "x86_64-unknown-fuchsia", "x86_64-pc-windows-msvc", "x86_64-pc-solaris", "x86_64-unknown-freebsd", "x86_64-unknown-illumos", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-unknown-netbsd", "x86_64-unknown-redox", "armv7-linux-androideabi", "i686-linux-android"]
6060
steps:
6161
- uses: actions/checkout@v3
6262
- uses: dtolnay/rust-toolchain@stable
@@ -79,7 +79,7 @@ jobs:
7979
strategy:
8080
fail-fast: false
8181
matrix:
82-
target: ["aarch64-apple-ios", "aarch64-linux-android", "x86_64-apple-darwin", "x86_64-unknown-fuchsia", "x86_64-pc-windows-msvc", "x86_64-pc-solaris", "x86_64-unknown-freebsd", "x86_64-unknown-illumos", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-unknown-netbsd", "x86_64-unknown-redox"]
82+
target: ["aarch64-apple-ios", "aarch64-linux-android", "x86_64-apple-darwin", "x86_64-unknown-fuchsia", "x86_64-pc-windows-msvc", "x86_64-pc-solaris", "x86_64-unknown-freebsd", "x86_64-unknown-illumos", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-unknown-netbsd", "x86_64-unknown-redox", "armv7-linux-androideabi", "i686-linux-android"]
8383
steps:
8484
- uses: actions/checkout@v3
8585
- uses: dtolnay/rust-toolchain@nightly # NOTE: need nightly for `doc_cfg` feature.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ include = [
2929
[package.metadata.docs.rs]
3030
all-features = true
3131
rustdoc-args = ["--cfg", "docsrs"]
32-
targets = ["aarch64-apple-ios", "aarch64-linux-android", "x86_64-apple-darwin", "x86_64-unknown-fuchsia", "x86_64-pc-windows-msvc", "x86_64-pc-solaris", "x86_64-unknown-freebsd", "x86_64-unknown-illumos", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-unknown-netbsd", "x86_64-unknown-redox"]
32+
targets = ["aarch64-apple-ios", "aarch64-linux-android", "x86_64-apple-darwin", "x86_64-unknown-fuchsia", "x86_64-pc-windows-msvc", "x86_64-pc-solaris", "x86_64-unknown-freebsd", "x86_64-unknown-illumos", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-unknown-netbsd", "x86_64-unknown-redox", "armv7-linux-androideabi", "i686-linux-android"]
3333

3434
[package.metadata.playground]
3535
features = ["all"]

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Targets available via Rustup that are supported.
22
# NOTE: keep in sync with the CI and docs.rs targets.
3-
TARGETS ?= "aarch64-apple-ios" "aarch64-linux-android" "x86_64-apple-darwin" "x86_64-unknown-fuchsia" "x86_64-pc-windows-msvc" "x86_64-pc-solaris" "x86_64-unknown-freebsd" "x86_64-unknown-illumos" "x86_64-unknown-linux-gnu" "x86_64-unknown-linux-musl" "x86_64-unknown-netbsd" "x86_64-unknown-redox"
3+
TARGETS ?= "aarch64-apple-ios" "aarch64-linux-android" "x86_64-apple-darwin" "x86_64-unknown-fuchsia" "x86_64-pc-windows-msvc" "x86_64-pc-solaris" "x86_64-unknown-freebsd" "x86_64-unknown-illumos" "x86_64-unknown-linux-gnu" "x86_64-unknown-linux-musl" "x86_64-unknown-netbsd" "x86_64-unknown-redox" "armv7-linux-androideabi" "i686-linux-android"
44

55
test:
66
cargo test --all-features

src/sys/unix.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ impl SockAddr {
691691
pub fn is_unnamed(&self) -> bool {
692692
self.as_sockaddr_un()
693693
.map(|storage| {
694-
self.len() == offset_of_path(storage) as u32
694+
self.len() == offset_of_path(storage) as _
695695
// On some non-linux platforms a zeroed path is returned for unnamed.
696696
// Abstract addresses only exist on Linux.
697697
// NOTE: although Fuchsia does define `AF_UNIX` it's not actually implemented.
@@ -754,7 +754,7 @@ impl SockAddr {
754754
/// pathname address, otherwise returns `None`.
755755
pub fn as_pathname(&self) -> Option<&Path> {
756756
self.as_sockaddr_un().and_then(|storage| {
757-
(self.len() > offset_of_path(storage) as u32 && storage.sun_path[0] != 0).then(|| {
757+
(self.len() > offset_of_path(storage) as _ && storage.sun_path[0] != 0).then(|| {
758758
let path_slice = self.path_bytes(storage, false);
759759
Path::new::<OsStr>(OsStrExt::from_bytes(path_slice))
760760
})
@@ -772,7 +772,7 @@ impl SockAddr {
772772
#[cfg(any(target_os = "linux", target_os = "android"))]
773773
{
774774
self.as_sockaddr_un().and_then(|storage| {
775-
(self.len() > offset_of_path(storage) as u32 && storage.sun_path[0] == 0)
775+
(self.len() > offset_of_path(storage) as _ && storage.sun_path[0] == 0)
776776
.then(|| self.path_bytes(storage, true))
777777
})
778778
}

0 commit comments

Comments
 (0)