File tree Expand file tree Collapse file tree 11 files changed +26
-60
lines changed Expand file tree Collapse file tree 11 files changed +26
-60
lines changed Original file line number Diff line number Diff line change @@ -331,20 +331,6 @@ macro_rules! safe_f {
331
331
) +} ;
332
332
}
333
333
334
- /// Define a nonpublic function.
335
- macro_rules! const_fn {
336
- ( $(
337
- $( #[ $attr: meta] ) *
338
- const fn $i: ident( $( $arg: ident: $argty: ty) ,* $( , ) * ) -> $ret: ty
339
- $body: block
340
- ) * ) => ( $(
341
- #[ inline]
342
- $( #[ $attr] ) *
343
- const fn $i( $( $arg: $argty) ,* ) -> $ret
344
- $body
345
- ) * )
346
- }
347
-
348
334
macro_rules! __item {
349
335
( $i: item) => {
350
336
$i
Original file line number Diff line number Diff line change @@ -1419,10 +1419,8 @@ pub const RTAX_MPLS2: c_int = 9;
1419
1419
pub const RTAX_MPLS3 : c_int = 10 ;
1420
1420
pub const RTAX_MAX : c_int = 11 ;
1421
1421
1422
- const_fn ! {
1423
- const fn _CMSG_ALIGN( n: usize ) -> usize {
1424
- ( n + ( size_of:: <c_long>( ) - 1 ) ) & !( size_of:: <c_long>( ) - 1 )
1425
- }
1422
+ const fn _CMSG_ALIGN ( n : usize ) -> usize {
1423
+ ( n + ( size_of :: < c_long > ( ) - 1 ) ) & !( size_of :: < c_long > ( ) - 1 )
1426
1424
}
1427
1425
1428
1426
f ! {
Original file line number Diff line number Diff line change @@ -4749,10 +4749,8 @@ pub const fn MAP_ALIGNED(a: c_int) -> c_int {
4749
4749
a << 24
4750
4750
}
4751
4751
4752
- const_fn ! {
4753
- const fn _ALIGN( p: usize ) -> usize {
4754
- ( p + _ALIGNBYTES) & !_ALIGNBYTES
4755
- }
4752
+ const fn _ALIGN ( p : usize ) -> usize {
4753
+ ( p + _ALIGNBYTES) & !_ALIGNBYTES
4756
4754
}
4757
4755
4758
4756
f ! {
Original file line number Diff line number Diff line change @@ -2301,10 +2301,8 @@ pub const TFD_NONBLOCK: i32 = crate::O_NONBLOCK;
2301
2301
pub const TFD_TIMER_ABSTIME : i32 = crate :: O_WRONLY ;
2302
2302
pub const TFD_TIMER_CANCEL_ON_SET : i32 = crate :: O_RDWR ;
2303
2303
2304
- const_fn ! {
2305
- const fn _ALIGN( p: usize ) -> usize {
2306
- ( p + _ALIGNBYTES) & !_ALIGNBYTES
2307
- }
2304
+ const fn _ALIGN ( p : usize ) -> usize {
2305
+ ( p + _ALIGNBYTES) & !_ALIGNBYTES
2308
2306
}
2309
2307
2310
2308
f ! {
Original file line number Diff line number Diff line change @@ -1868,10 +1868,8 @@ pub const RTAX_STATIC: c_int = 13;
1868
1868
pub const RTAX_SEARCH : c_int = 14 ;
1869
1869
pub const RTAX_MAX : c_int = 15 ;
1870
1870
1871
- const_fn ! {
1872
- const fn _ALIGN( p: usize ) -> usize {
1873
- ( p + _ALIGNBYTES) & !_ALIGNBYTES
1874
- }
1871
+ const fn _ALIGN ( p : usize ) -> usize {
1872
+ ( p + _ALIGNBYTES) & !_ALIGNBYTES
1875
1873
}
1876
1874
1877
1875
f ! {
Original file line number Diff line number Diff line change @@ -1928,10 +1928,8 @@ safe_f! {
1928
1928
}
1929
1929
}
1930
1930
1931
- const_fn ! {
1932
- const fn CMSG_ALIGN ( len: usize ) -> usize {
1933
- len + size_of:: <usize >( ) - 1 & !( size_of:: <usize >( ) - 1 )
1934
- }
1931
+ const fn CMSG_ALIGN ( len : usize ) -> usize {
1932
+ len + size_of :: < usize > ( ) - 1 & !( size_of :: < usize > ( ) - 1 )
1935
1933
}
1936
1934
1937
1935
extern "C" {
Original file line number Diff line number Diff line change @@ -1514,10 +1514,8 @@ pub const POSIX_SPAWN_SETSIGDEF: c_int = 0x10;
1514
1514
pub const POSIX_SPAWN_SETSIGMASK : c_int = 0x20 ;
1515
1515
pub const POSIX_SPAWN_SETSID : c_int = 0x40 ;
1516
1516
1517
- const_fn ! {
1518
- const fn CMSG_ALIGN ( len: usize ) -> usize {
1519
- len + size_of:: <usize >( ) - 1 & !( size_of:: <usize >( ) - 1 )
1520
- }
1517
+ const fn CMSG_ALIGN ( len : usize ) -> usize {
1518
+ len + size_of :: < usize > ( ) - 1 & !( size_of :: < usize > ( ) - 1 )
1521
1519
}
1522
1520
1523
1521
f ! {
Original file line number Diff line number Diff line change @@ -3414,10 +3414,8 @@ pub const PTHREAD_STACK_MIN: size_t = 0;
3414
3414
// Non-public helper constants
3415
3415
const _UTSNAME_LENGTH: usize = 1024 ;
3416
3416
3417
- const_fn ! {
3418
- const fn CMSG_ALIGN ( len: usize ) -> usize {
3419
- ( len + size_of:: <usize >( ) - 1 ) & !( size_of:: <usize >( ) - 1 )
3420
- }
3417
+ const fn CMSG_ALIGN ( len : usize ) -> usize {
3418
+ ( len + size_of :: < usize > ( ) - 1 ) & !( size_of :: < usize > ( ) - 1 )
3421
3419
}
3422
3420
3423
3421
// functions
Original file line number Diff line number Diff line change @@ -1784,10 +1784,8 @@ cfg_if! {
1784
1784
}
1785
1785
}
1786
1786
1787
- const_fn ! {
1788
- const fn CMSG_ALIGN ( len: usize ) -> usize {
1789
- ( len + size_of:: <usize >( ) - 1 ) & !( size_of:: <usize >( ) - 1 )
1790
- }
1787
+ const fn CMSG_ALIGN ( len : usize ) -> usize {
1788
+ ( len + size_of :: < usize > ( ) - 1 ) & !( size_of :: < usize > ( ) - 1 )
1791
1789
}
1792
1790
1793
1791
f ! {
Original file line number Diff line number Diff line change @@ -2607,14 +2607,12 @@ pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
2607
2607
__spare : 0 ,
2608
2608
} ;
2609
2609
2610
- const_fn ! {
2611
- const fn _CMSG_ALIGN( len: usize ) -> usize {
2612
- len + size_of:: <usize >( ) - 1 & !( size_of:: <usize >( ) - 1 )
2613
- }
2610
+ const fn _CMSG_ALIGN ( len : usize ) -> usize {
2611
+ len + size_of :: < usize > ( ) - 1 & !( size_of :: < usize > ( ) - 1 )
2612
+ }
2614
2613
2615
- const fn _ALIGN( p: usize , b: usize ) -> usize {
2616
- ( p + b - 1 ) & !( b - 1 )
2617
- }
2614
+ const fn _ALIGN ( p : usize , b : usize ) -> usize {
2615
+ ( p + b - 1 ) & !( b - 1 )
2618
2616
}
2619
2617
2620
2618
f ! {
You can’t perform that action at this time.
0 commit comments