瀏覽代碼

Merge pull request #969 from thvdveld/fix-cfgs

Fix target-arch names and remove unknonwn fuzzing cfg warning
Dario Nieuwenhuis 7 月之前
父節點
當前提交
2d4dde7c92
共有 2 個文件被更改,包括 6 次插入3 次删除
  1. 3 0
      Cargo.toml
  2. 3 3
      src/phy/sys/linux.rs

+ 3 - 0
Cargo.toml

@@ -16,6 +16,9 @@ license = "0BSD"
 # ensure that the correct features are enabled.
 autoexamples = false
 
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] }
+
 [dependencies]
 managed = { version = "0.8", default-features = false, features = ["map"] }
 byteorder = { version = "1.0", default-features = false }

+ 3 - 3
src/phy/sys/linux.rs

@@ -9,12 +9,12 @@ pub const ETH_P_IEEE802154: libc::c_short = 0x00F6;
 // https://github.com/golang/sys/blob/master/unix/zerrors_linux_<arch>.go
 pub const TUNSETIFF: libc::c_ulong = if cfg!(any(
     target_arch = "mips",
+    all(target_arch = "mips", target_endian = "little"),
     target_arch = "mips64",
-    target_arch = "mips64el",
-    target_arch = "mipsel",
+    all(target_arch = "mips64", target_endian = "little"),
     target_arch = "powerpc",
     target_arch = "powerpc64",
-    target_arch = "powerpc64le",
+    all(target_arch = "powerpc64", target_endian = "little"),
     target_arch = "sparc64"
 )) {
     0x800454CA