diff options
author | JohnTitor <huyuumi.dev@gmail.com> | 2021-03-30 15:28:55 +0900 |
---|---|---|
committer | JohnTitor <huyuumi.dev@gmail.com> | 2021-03-30 17:37:13 +0900 |
commit | e187543fddad0f252dae395508a47748dbf963e1 (patch) | |
tree | 5eb4fbb9973cd7cd7e37089732f7459f8ce520b1 /src/unix/bsd/freebsdlike/dragonfly/mod.rs | |
parent | f913fc53a682c7b836bdf2ac0da601f2d8334b32 (diff) | |
download | rust-libc-e187543fddad0f252dae395508a47748dbf963e1.tar.gz |
Constify `CMSG_SPACE` for all the targets
Diffstat (limited to 'src/unix/bsd/freebsdlike/dragonfly/mod.rs')
-rw-r--r-- | src/unix/bsd/freebsdlike/dragonfly/mod.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 7056cc5484..2a803bd197 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -1020,8 +1020,10 @@ pub const SF_XLINK: ::c_ulong = 0x01000000; pub const UTIME_OMIT: c_long = -2; pub const UTIME_NOW: c_long = -1; -fn _CMSG_ALIGN(n: usize) -> usize { - (n + 3) & !3 +const_fn! { + {const} fn _CMSG_ALIGN(n: usize) -> usize { + (n + 3) & !3 + } } f! { @@ -1050,7 +1052,7 @@ f! { } } - pub fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { + pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { (_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) + _CMSG_ALIGN(length as usize)) as ::c_uint } |