Skip to content
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

Constify CMSG_LEN for all targets. #3241

Merged
merged 1 commit into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/fuchsia/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3271,7 +3271,7 @@ f! {
as ::c_uint
}

pub fn CMSG_LEN(len: ::c_uint) -> ::c_uint {
pub {const} fn CMSG_LEN(len: ::c_uint) -> ::c_uint {
(CMSG_ALIGN(::mem::size_of::<cmsghdr>()) + len as ::size_t) as ::c_uint
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/unix/aix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2551,7 +2551,7 @@ f! {
(cmsg as *mut ::c_uchar).offset(::mem::size_of::<::cmsghdr>() as isize)
}

pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
::mem::size_of::<::cmsghdr>() as ::c_uint + length
}

Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5107,7 +5107,7 @@ f! {
as ::c_uint
}

pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
(__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) + length as usize)
as ::c_uint
}
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/freebsdlike/dragonfly/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,7 @@ f! {
.offset(_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
}

pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
(_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) + length as usize)
as ::c_uint
}
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4717,7 +4717,7 @@ f! {
.offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
}

pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
_ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
}

Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/netbsdlike/netbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2422,7 +2422,7 @@ f! {
.offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
}

pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
_ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
}

Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/netbsdlike/openbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1705,7 +1705,7 @@ f! {
.offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
}

pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
_ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
}

Expand Down
2 changes: 1 addition & 1 deletion src/unix/haiku/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,7 @@ f! {
as ::c_uint
}

pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
CMSG_ALIGN(::mem::size_of::<cmsghdr>()) as ::c_uint + length
}

Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1557,7 +1557,7 @@ f! {
as ::c_uint
}

pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
CMSG_ALIGN(::mem::size_of::<cmsghdr>()) as ::c_uint + length
}

Expand Down
2 changes: 1 addition & 1 deletion src/unix/nto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2539,7 +2539,7 @@ f! {
.offset(_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
}

pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
}

Expand Down
2 changes: 1 addition & 1 deletion src/unix/solarish/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2601,7 +2601,7 @@ f! {
_CMSG_DATA_ALIGN(cmsg.offset(1) as usize) as *mut ::c_uchar
}

pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
_CMSG_DATA_ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
}

Expand Down
2 changes: 1 addition & 1 deletion src/vxworks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ f! {
as ::c_uint
}

pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
CMSG_ALIGN(::mem::size_of::<cmsghdr>()) as ::c_uint + length
}
}
Expand Down