Skip to content

Commit

Permalink
Deprecate AF_MAX and PF_MAX
Browse files Browse the repository at this point in the history
  • Loading branch information
gnzlbg committed May 28, 2019
1 parent 48193e8 commit dddb9fb
Show file tree
Hide file tree
Showing 26 changed files with 261 additions and 8 deletions.
4 changes: 3 additions & 1 deletion libc-test/test/linux_elf.rs
Expand Up @@ -7,4 +7,6 @@ use libc::*;
include!(concat!(env!("OUT_DIR"), "/linux_elf.rs"));

#[cfg(not(target_os = "linux"))]
fn main() { println!("PASSED 0 tests"); }
fn main() {
println!("PASSED 0 tests");
}
4 changes: 3 additions & 1 deletion libc-test/test/linux_fcntl.rs
Expand Up @@ -7,4 +7,6 @@ use libc::*;
include!(concat!(env!("OUT_DIR"), "/linux_fcntl.rs"));

#[cfg(not(any(target_os = "linux", target_os = "android")))]
fn main() { println!("PASSED 0 tests"); }
fn main() {
println!("PASSED 0 tests");
}
4 changes: 3 additions & 1 deletion libc-test/test/linux_ipv6.rs
Expand Up @@ -7,4 +7,6 @@ use libc::*;
include!(concat!(env!("OUT_DIR"), "/linux_ipv6.rs"));

#[cfg(not(target_os = "linux"))]
fn main() { println!("PASSED 0 tests"); }
fn main() {
println!("PASSED 0 tests");
}
4 changes: 3 additions & 1 deletion libc-test/test/linux_strerror_r.rs
Expand Up @@ -7,4 +7,6 @@ use libc::*;
include!(concat!(env!("OUT_DIR"), "/linux_strerror_r.rs"));

#[cfg(not(any(target_os = "linux", target_os = "android")))]
fn main() { println!("PASSED 0 tests"); }
fn main() {
println!("PASSED 0 tests");
}
4 changes: 3 additions & 1 deletion libc-test/test/linux_termios.rs
Expand Up @@ -7,4 +7,6 @@ use libc::*;
include!(concat!(env!("OUT_DIR"), "/linux_termios.rs"));

#[cfg(not(any(target_os = "linux", target_os = "android")))]
fn main() { println!("PASSED 0 tests"); }
fn main() {
println!("PASSED 0 tests");
}
10 changes: 10 additions & 0 deletions src/fuchsia/aarch64.rs
Expand Up @@ -66,8 +66,18 @@ pub const MINSIGSTKSZ: ::size_t = 6144;
pub const SIGSTKSZ: ::size_t = 12288;

#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
pub const PF_MAX: ::c_int = 43;
#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
pub const AF_MAX: ::c_int = PF_MAX;

pub const SYS_io_setup: ::c_long = 0;
Expand Down
11 changes: 11 additions & 0 deletions src/fuchsia/x86_64.rs
Expand Up @@ -486,6 +486,17 @@ pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;

#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
pub const AF_MAX: ::c_int = 42;
#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
#[allow(deprecated)]
pub const PF_MAX: ::c_int = AF_MAX;
19 changes: 17 additions & 2 deletions src/unix/bsd/apple/mod.rs
Expand Up @@ -2083,6 +2083,11 @@ pub const AF_NETBIOS: ::c_int = 33;
pub const AF_PPP: ::c_int = 34;
pub const pseudo_AF_HDRCMPLT: ::c_int = 35;
#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
pub const AF_MAX: ::c_int = 40;
pub const AF_SYS_CONTROL: ::c_int = 2;

Expand Down Expand Up @@ -2125,11 +2130,21 @@ pub const PF_SYSTEM: ::c_int = AF_SYSTEM;
pub const PF_NETBIOS: ::c_int = AF_NETBIOS;
pub const PF_PPP: ::c_int = AF_PPP;
#[doc(hidden)]
#[deprecated(since = "0.2.55")]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
#[allow(deprecated)]
pub const PF_MAX: ::c_int = AF_MAX;

#[doc(hidden)]
#[deprecated(since = "0.2.55")]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
#[allow(deprecated)]
pub const NET_MAXID: ::c_int = AF_MAX;

pub const NET_RT_DUMP: ::c_int = 1;
Expand Down
19 changes: 19 additions & 0 deletions src/unix/bsd/freebsdlike/dragonfly/mod.rs
Expand Up @@ -891,9 +891,22 @@ pub const TCP_FASTKEEP: ::c_int = 128;
pub const AF_BLUETOOTH: ::c_int = 33;
pub const AF_MPLS: ::c_int = 34;
pub const AF_IEEE80211: ::c_int = 35;
#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
pub const AF_MAX: ::c_int = 36;

pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
#[allow(deprecated)]
pub const PF_MAX: ::c_int = AF_MAX;

pub const NET_RT_DUMP: ::c_int = 1;
Expand All @@ -904,6 +917,12 @@ pub const NET_RT_MAXID: ::c_int = 4;
pub const SOMAXOPT_SIZE: ::c_int = 65536;

#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
#[allow(deprecated)]
pub const NET_MAXID: ::c_int = AF_MAX;

pub const MSG_UNUSED09: ::c_int = 0x00000200;
Expand Down
13 changes: 12 additions & 1 deletion src/unix/bsd/freebsdlike/freebsd/mod.rs
Expand Up @@ -625,6 +625,11 @@ pub const AF_IEEE80211: ::c_int = 37;
pub const AF_INET_SDP: ::c_int = 40;
pub const AF_INET6_SDP: ::c_int = 42;
#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
pub const AF_MAX: ::c_int = 42;

// https://github.com/freebsd/freebsd/blob/master/sys/net/if.h#L140
Expand All @@ -636,7 +641,6 @@ pub const IFF_POINTOPOINT: ::c_int = 0x10; // (i) is a point-to-point link
// 0x20 was IFF_SMART
pub const IFF_RUNNING: ::c_int = 0x40; // (d) resources allocated
#[doc(hidden)]
#[doc(hidden)]
#[deprecated(
since="0.2.54",
note="IFF_DRV_RUNNING is deprecated. Use the portable IFF_RUNNING instead"
Expand Down Expand Up @@ -934,6 +938,12 @@ pub const PF_IEEE80211: ::c_int = AF_IEEE80211;
pub const PF_INET_SDP: ::c_int = AF_INET_SDP;
pub const PF_INET6_SDP: ::c_int = AF_INET6_SDP;
#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
#[allow(deprecated)]
pub const PF_MAX: ::c_int = AF_MAX;

pub const NET_RT_DUMP: ::c_int = 1;
Expand Down Expand Up @@ -971,6 +981,7 @@ pub const SHM_ANON: *mut ::c_char = 1 as *mut ::c_char;
// compatibility only, and are scheduled to be removed in libc 1.0.0.
#[doc(hidden)]
#[deprecated(since="0.2.54",note="Removed in FreeBSD 11")]
#[allow(deprecated)]
pub const NET_MAXID: ::c_int = AF_MAX;
#[doc(hidden)]
#[deprecated(since="0.2.54",note="Removed in FreeBSD 11")]
Expand Down
21 changes: 21 additions & 0 deletions src/unix/bsd/netbsdlike/netbsd/mod.rs
Expand Up @@ -853,8 +853,21 @@ pub const AF_BLUETOOTH: ::c_int = 31;
pub const AF_IEEE80211: ::c_int = 32;
pub const AF_MPLS: ::c_int = 33;
pub const AF_ROUTE: ::c_int = 34;
#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
pub const AF_MAX: ::c_int = 36;

#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
#[allow(deprecated)]
pub const NET_MAXID: ::c_int = AF_MAX;
pub const NET_RT_DUMP: ::c_int = 1;
pub const NET_RT_FLAGS: ::c_int = 2;
Expand All @@ -870,6 +883,14 @@ pub const PF_KEY: ::c_int = pseudo_AF_KEY;
pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
pub const PF_MPLS: ::c_int = AF_MPLS;
pub const PF_ROUTE: ::c_int = AF_ROUTE;

#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
#[allow(deprecated)]
pub const PF_MAX: ::c_int = AF_MAX;

pub const MSG_NBIO: ::c_int = 0x1000;
Expand Down
17 changes: 17 additions & 0 deletions src/unix/bsd/netbsdlike/openbsd/mod.rs
Expand Up @@ -835,9 +835,20 @@ pub const AF_MPLS: ::c_int = 33;
pub const pseudo_AF_PFLOW: ::c_int = 34;
pub const pseudo_AF_PIPEX: ::c_int = 35;
#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
pub const AF_MAX: ::c_int = 36;

#[doc(hidden)]
#[allow(deprecated)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
pub const NET_MAXID: ::c_int = AF_MAX;
pub const NET_RT_DUMP: ::c_int = 1;
pub const NET_RT_FLAGS: ::c_int = 2;
Expand All @@ -862,6 +873,12 @@ pub const PF_MPLS: ::c_int = AF_MPLS;
pub const PF_PFLOW: ::c_int = pseudo_AF_PFLOW;
pub const PF_PIPEX: ::c_int = pseudo_AF_PIPEX;
#[doc(hidden)]
#[allow(deprecated)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
pub const PF_MAX: ::c_int = AF_MAX;

pub const SCM_TIMESTAMP: ::c_int = 0x04;
Expand Down
6 changes: 6 additions & 0 deletions src/unix/haiku/mod.rs
Expand Up @@ -770,6 +770,12 @@ pub const AF_NOTIFY: ::c_int = 8;
pub const AF_LOCAL: ::c_int = 9;
pub const AF_UNIX: ::c_int = AF_LOCAL;
pub const AF_BLUETOOTH: ::c_int = 10;
#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
pub const AF_MAX: ::c_int = 11;

pub const IP_OPTIONS: ::c_int = 1;
Expand Down
11 changes: 11 additions & 0 deletions src/unix/notbsd/android/mod.rs
Expand Up @@ -918,8 +918,19 @@ pub const SOL_NETROM: ::c_int = 259;
pub const SOL_ROSE: ::c_int = 260;

#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
pub const AF_MAX: ::c_int = 43;
#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
#[allow(deprecated)]
pub const PF_MAX: ::c_int = AF_MAX;

/* DCCP socket options */
Expand Down
11 changes: 11 additions & 0 deletions src/unix/notbsd/emscripten/mod.rs
Expand Up @@ -922,12 +922,23 @@ pub const AF_MPLS: ::c_int = 28;
pub const AF_NFC: ::c_int = 39;
pub const AF_VSOCK: ::c_int = 40;
#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
pub const AF_MAX: ::c_int = 42;
pub const PF_IB: ::c_int = AF_IB;
pub const PF_MPLS: ::c_int = AF_MPLS;
pub const PF_NFC: ::c_int = AF_NFC;
pub const PF_VSOCK: ::c_int = AF_VSOCK;
#[doc(hidden)]
#[allow(deprecated)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
pub const PF_MAX: ::c_int = AF_MAX;

// System V IPC
Expand Down
11 changes: 11 additions & 0 deletions src/unix/notbsd/linux/mips/mod.rs
Expand Up @@ -895,8 +895,19 @@ pub const NFT_NG_INCREMENTAL: ::c_int = 0;
pub const NFT_NG_RANDOM: ::c_int = 1;

#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
pub const AF_MAX: ::c_int = 45;
#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
#[allow(deprecated)]
pub const PF_MAX: ::c_int = AF_MAX;

f! {
Expand Down
11 changes: 11 additions & 0 deletions src/unix/notbsd/linux/musl/b32/arm.rs
Expand Up @@ -839,6 +839,17 @@ pub const SYS_pkey_alloc: ::c_long = 395;
pub const SYS_pkey_free: ::c_long = 396;

#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
pub const AF_MAX: ::c_int = 45;
#[doc(hidden)]
#[allow(deprecated)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
pub const PF_MAX: ::c_int = AF_MAX;
11 changes: 11 additions & 0 deletions src/unix/notbsd/linux/musl/b32/mips.rs
Expand Up @@ -848,6 +848,17 @@ pub const SYS_preadv2: ::c_long = 4000 + 361;
pub const SYS_pwritev2: ::c_long = 4000 + 362;

#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
pub const AF_MAX: ::c_int = 42;
#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
#[allow(deprecated)]
pub const PF_MAX: ::c_int = AF_MAX;
11 changes: 11 additions & 0 deletions src/unix/notbsd/linux/musl/b32/powerpc.rs
Expand Up @@ -865,6 +865,17 @@ pub const SYS_pkey_free: ::c_long = 385;
pub const SYS_pkey_mprotect: ::c_long = 386;

#[doc(hidden)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
pub const AF_MAX: ::c_int = 43;
#[doc(hidden)]
#[allow(deprecated)]
#[deprecated(
since = "0.2.55",
note = "If you are using this report to: \
https://github.com/rust-lang/libc/issues/665"
)]
pub const PF_MAX: ::c_int = AF_MAX;

0 comments on commit dddb9fb

Please sign in to comment.