From d8af6bf5acdd42d3d485f2876456daa3ade8b85a Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Wed, 22 May 2024 01:39:42 +0700 Subject: [PATCH] Revert "style: remove _MAX* place holder constants" This reverts commit 0f93088faadb13375344e04ef06ffa7503526d13. `RTAX_MAX` is used to loop over alternate internal encoding. --- src/unix/bsd/freebsdlike/dragonfly/mod.rs | 1 + src/unix/bsd/freebsdlike/freebsd/mod.rs | 2 ++ src/unix/bsd/netbsdlike/netbsd/mod.rs | 1 + src/unix/bsd/netbsdlike/openbsd/mod.rs | 1 + 4 files changed, 5 insertions(+) diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 363487f964b13..9b3b872d03948 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -1533,6 +1533,7 @@ pub const RTM_VERSION: ::c_int = 7; pub const RTAX_MPLS1: ::c_int = 8; pub const RTAX_MPLS2: ::c_int = 9; pub const RTAX_MPLS3: ::c_int = 10; +pub const RTAX_MAX: ::c_int = 11; const_fn! { {const} fn _CMSG_ALIGN(n: usize) -> usize { diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index e729b1fb2ea81..dc86dd1d723c6 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -4561,6 +4561,8 @@ pub const RTF_FIXEDMTU: ::c_int = 0x80000; pub const RTM_VERSION: ::c_int = 5; +pub const RTAX_MAX: ::c_int = 8; + // sys/signal.h pub const SIGTHR: ::c_int = 32; pub const SIGLWP: ::c_int = SIGTHR; diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index 2a9d9fb5125eb..ac346fad6fc4f 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -2439,6 +2439,7 @@ pub const RTM_CHGADDR: ::c_int = 0x18; pub const RTA_TAG: ::c_int = 0x100; pub const RTAX_TAG: ::c_int = 8; +pub const RTAX_MAX: ::c_int = 9; cfg_if! { diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs index d3aa65c2d89b3..b397be291ff98 100644 --- a/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -1962,6 +1962,7 @@ pub const RTAX_BFD: ::c_int = 11; pub const RTAX_DNS: ::c_int = 12; pub const RTAX_STATIC: ::c_int = 13; pub const RTAX_SEARCH: ::c_int = 14; +pub const RTAX_MAX: ::c_int = 15; const_fn! { {const} fn _ALIGN(p: usize) -> usize {