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 34
34
#![ no_std]
35
35
#![ cfg_attr( feature = "rustc-dep-of-std" , no_core) ]
36
36
#![ cfg_attr( target_os = "redox" , feature( static_nobundle) ) ]
37
+ #![ feature( const_extern_fn) ]
37
38
38
39
#[ macro_use]
39
40
mod macros;
Original file line number Diff line number Diff line change @@ -123,11 +123,11 @@ macro_rules! s_no_extra_traits {
123
123
124
124
#[ allow( unused_macros) ]
125
125
macro_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 {
127
127
$( $body: stmt) ;*
128
128
} ) * ) => ( $(
129
129
#[ inline]
130
- pub unsafe extern fn $i( $( $arg: $argty) ,* ) -> $ret {
130
+ pub $ ( $constness ) * unsafe extern fn $i( $( $arg: $argty) ,* ) -> $ret {
131
131
$( $body) ;*
132
132
}
133
133
) * )
Original file line number Diff line number Diff line change @@ -1165,7 +1165,7 @@ pub const ARPHRD_IEEE802154: u16 = 804;
1165
1165
pub const ARPHRD_VOID : u16 = 0xFFFF ;
1166
1166
pub const ARPHRD_NONE : u16 = 0xFFFE ;
1167
1167
1168
- fn CMSG_ALIGN ( len : usize ) -> usize {
1168
+ const fn CMSG_ALIGN ( len : usize ) -> usize {
1169
1169
len + :: mem:: size_of :: < usize > ( ) - 1 & !( :: mem:: size_of :: < usize > ( ) - 1 )
1170
1170
}
1171
1171
@@ -1182,7 +1182,7 @@ f! {
1182
1182
cmsg. offset( 1 ) as * mut :: c_uchar
1183
1183
}
1184
1184
1185
- pub fn CMSG_SPACE ( length: :: c_uint) -> :: c_uint {
1185
+ pub fn CMSG_SPACE ( length: :: c_uint) const -> :: c_uint {
1186
1186
( CMSG_ALIGN ( length as usize ) + CMSG_ALIGN ( :: mem:: size_of:: <cmsghdr>( ) ) )
1187
1187
as :: c_uint
1188
1188
}
You can’t perform that action at this time.
0 commit comments