File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 3434#![ no_std]
3535#![ cfg_attr( feature = "rustc-dep-of-std" , no_core) ]
3636#![ cfg_attr( target_os = "redox" , feature( static_nobundle) ) ]
37+ #![ feature( const_extern_fn) ]
3738
3839#[ macro_use]
3940mod macros;
Original file line number Diff line number Diff line change @@ -123,11 +123,11 @@ macro_rules! s_no_extra_traits {
123123
124124#[ allow( unused_macros) ]
125125macro_rules! f {
126- ( $( pub fn $i: ident( $( $arg: ident: $argty: ty) ,* ) -> $ret: ty {
126+ ( $( pub fn $i: ident( $( $arg: ident: $argty: ty) ,* ) $ ( $constness : ident ) * -> $ret: ty {
127127 $( $body: stmt) ;*
128128 } ) * ) => ( $(
129129 #[ inline]
130- pub unsafe extern fn $i( $( $arg: $argty) ,* ) -> $ret {
130+ pub $ ( $constness ) * unsafe extern fn $i( $( $arg: $argty) ,* ) -> $ret {
131131 $( $body) ;*
132132 }
133133 ) * )
Original file line number Diff line number Diff line change @@ -1165,7 +1165,7 @@ pub const ARPHRD_IEEE802154: u16 = 804;
11651165pub const ARPHRD_VOID : u16 = 0xFFFF ;
11661166pub const ARPHRD_NONE : u16 = 0xFFFE ;
11671167
1168- fn CMSG_ALIGN ( len : usize ) -> usize {
1168+ const fn CMSG_ALIGN ( len : usize ) -> usize {
11691169 len + :: mem:: size_of :: < usize > ( ) - 1 & !( :: mem:: size_of :: < usize > ( ) - 1 )
11701170}
11711171
@@ -1182,7 +1182,7 @@ f! {
11821182 cmsg. offset( 1 ) as * mut :: c_uchar
11831183 }
11841184
1185- pub fn CMSG_SPACE ( length: :: c_uint) -> :: c_uint {
1185+ pub fn CMSG_SPACE ( length: :: c_uint) const -> :: c_uint {
11861186 ( CMSG_ALIGN ( length as usize ) + CMSG_ALIGN ( :: mem:: size_of:: <cmsghdr>( ) ) )
11871187 as :: c_uint
11881188 }
You can’t perform that action at this time.
0 commit comments