File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -415,13 +415,11 @@ impl Ipv6MembershipRequest {
415
415
macro_rules! cmsg_space {
416
416
( $( $x: ty ) ,* ) => {
417
417
{
418
- use nix:: sys:: socket:: { c_uint, CMSG_SPACE } ;
419
- use std:: mem;
420
418
let mut space = 0 ;
421
419
$(
422
420
// CMSG_SPACE is always safe
423
421
space += unsafe {
424
- CMSG_SPACE ( mem:: size_of:: <$x>( ) as c_uint)
422
+ $crate :: sys :: socket :: CMSG_SPACE ( :: std :: mem:: size_of:: <$x>( ) as $crate :: sys :: socket :: c_uint)
425
423
} as usize ;
426
424
) *
427
425
Vec :: <u8 >:: with_capacity( space)
@@ -1789,3 +1787,11 @@ pub fn shutdown(df: RawFd, how: Shutdown) -> Result<()> {
1789
1787
Errno :: result ( shutdown ( df, how) ) . map ( drop)
1790
1788
}
1791
1789
}
1790
+
1791
+ #[ cfg( test) ]
1792
+ mod tests {
1793
+ #[ test]
1794
+ fn can_use_cmsg_space ( ) {
1795
+ let _ = cmsg_space ! ( u8 ) ;
1796
+ }
1797
+ }
You can’t perform that action at this time.
0 commit comments