66// option. This file may not be copied, modified, or distributed
77// except according to those terms.
88
9- #[ cfg( any(
10- target_os = "dragonfly" ,
11- target_os = "freebsd" ,
12- target_os = "openbsd" ,
13- target_os = "netbsd" ,
14- target_os = "solaris" ,
15- target_os = "illumos" ,
16- target_os = "nto"
17- ) ) ]
18- use std:: ffi:: c_uchar;
199use std:: fmt;
2010use std:: io:: { self , Read , Write } ;
2111#[ cfg( not( target_os = "redox" ) ) ]
@@ -37,28 +27,6 @@ use crate::{Domain, Protocol, SockAddr, TcpKeepalive, Type};
3727#[ cfg( not( target_os = "redox" ) ) ]
3828use crate :: { MaybeUninitSlice , MsgHdr , RecvFlags } ;
3929
40- #[ cfg( any(
41- target_os = "dragonfly" ,
42- target_os = "freebsd" ,
43- target_os = "openbsd" ,
44- target_os = "netbsd" ,
45- target_os = "solaris" ,
46- target_os = "illumos" ,
47- target_os = "nto"
48- ) ) ]
49- type IpV4MultiCastType = c_uchar ;
50-
51- #[ cfg( not( any(
52- target_os = "dragonfly" ,
53- target_os = "freebsd" ,
54- target_os = "openbsd" ,
55- target_os = "netbsd" ,
56- target_os = "solaris" ,
57- target_os = "illumos" ,
58- target_os = "nto"
59- ) ) ) ]
60- type IpV4MultiCastType = c_int ;
61-
6230/// Owned wrapper around a system socket.
6331///
6432/// This type simply wraps an instance of a file descriptor (`c_int`) on Unix
@@ -1546,7 +1514,7 @@ impl Socket {
15461514 /// [`set_multicast_ttl_v4`]: Socket::set_multicast_ttl_v4
15471515 pub fn multicast_ttl_v4 ( & self ) -> io:: Result < u32 > {
15481516 unsafe {
1549- getsockopt :: < IpV4MultiCastType > ( self . as_raw ( ) , sys:: IPPROTO_IP , sys:: IP_MULTICAST_TTL )
1517+ getsockopt :: < c_int > ( self . as_raw ( ) , sys:: IPPROTO_IP , sys:: IP_MULTICAST_TTL )
15501518 . map ( |ttl| ttl as u32 )
15511519 }
15521520 }
@@ -1564,7 +1532,7 @@ impl Socket {
15641532 self . as_raw ( ) ,
15651533 sys:: IPPROTO_IP ,
15661534 sys:: IP_MULTICAST_TTL ,
1567- ttl as IpV4MultiCastType ,
1535+ ttl as c_int ,
15681536 )
15691537 }
15701538 }
0 commit comments