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 @@ -326,20 +326,6 @@ macro_rules! safe_f {
326
326
) +} ;
327
327
}
328
328
329
- /// Define a nonpublic function.
330
- macro_rules! const_fn {
331
- ( $(
332
- $( #[ $attr: meta] ) *
333
- const fn $i: ident( $( $arg: ident: $argty: ty) ,* $( , ) * ) -> $ret: ty
334
- $body: block
335
- ) * ) => ( $(
336
- #[ inline]
337
- $( #[ $attr] ) *
338
- const fn $i( $( $arg: $argty) ,* ) -> $ret
339
- $body
340
- ) * )
341
- }
342
-
343
329
macro_rules! __item {
344
330
( $i: item) => {
345
331
$i
Original file line number Diff line number Diff line change @@ -1421,10 +1421,8 @@ pub const RTAX_MPLS2: c_int = 9;
1421
1421
pub const RTAX_MPLS3 : c_int = 10 ;
1422
1422
pub const RTAX_MAX : c_int = 11 ;
1423
1423
1424
- const_fn ! {
1425
- const fn _CMSG_ALIGN( n: usize ) -> usize {
1426
- ( n + ( size_of:: <c_long>( ) - 1 ) ) & !( size_of:: <c_long>( ) - 1 )
1427
- }
1424
+ const fn _CMSG_ALIGN ( n : usize ) -> usize {
1425
+ ( n + ( size_of :: < c_long > ( ) - 1 ) ) & !( size_of :: < c_long > ( ) - 1 )
1428
1426
}
1429
1427
1430
1428
f ! {
Original file line number Diff line number Diff line change @@ -4655,10 +4655,8 @@ pub const fn MAP_ALIGNED(a: c_int) -> c_int {
4655
4655
a << 24
4656
4656
}
4657
4657
4658
- const_fn ! {
4659
- const fn _ALIGN( p: usize ) -> usize {
4660
- ( p + _ALIGNBYTES) & !_ALIGNBYTES
4661
- }
4658
+ const fn _ALIGN ( p : usize ) -> usize {
4659
+ ( p + _ALIGNBYTES) & !_ALIGNBYTES
4662
4660
}
4663
4661
4664
4662
f ! {
Original file line number Diff line number Diff line change @@ -2300,10 +2300,8 @@ pub const TFD_NONBLOCK: i32 = crate::O_NONBLOCK;
2300
2300
pub const TFD_TIMER_ABSTIME : i32 = crate :: O_WRONLY ;
2301
2301
pub const TFD_TIMER_CANCEL_ON_SET : i32 = crate :: O_RDWR ;
2302
2302
2303
- const_fn ! {
2304
- const fn _ALIGN( p: usize ) -> usize {
2305
- ( p + _ALIGNBYTES) & !_ALIGNBYTES
2306
- }
2303
+ const fn _ALIGN ( p : usize ) -> usize {
2304
+ ( p + _ALIGNBYTES) & !_ALIGNBYTES
2307
2305
}
2308
2306
2309
2307
f ! {
Original file line number Diff line number Diff line change @@ -1851,10 +1851,8 @@ pub const RTAX_STATIC: c_int = 13;
1851
1851
pub const RTAX_SEARCH : c_int = 14 ;
1852
1852
pub const RTAX_MAX : c_int = 15 ;
1853
1853
1854
- const_fn ! {
1855
- const fn _ALIGN( p: usize ) -> usize {
1856
- ( p + _ALIGNBYTES) & !_ALIGNBYTES
1857
- }
1854
+ const fn _ALIGN ( p : usize ) -> usize {
1855
+ ( p + _ALIGNBYTES) & !_ALIGNBYTES
1858
1856
}
1859
1857
1860
1858
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 @@ -1512,10 +1512,8 @@ pub const POSIX_SPAWN_SETSIGDEF: c_short = 0x10;
1512
1512
pub const POSIX_SPAWN_SETSIGMASK : c_short = 0x20 ;
1513
1513
pub const POSIX_SPAWN_SETSID : c_short = 0x40 ;
1514
1514
1515
- const_fn ! {
1516
- const fn CMSG_ALIGN ( len: usize ) -> usize {
1517
- len + size_of:: <usize >( ) - 1 & !( size_of:: <usize >( ) - 1 )
1518
- }
1515
+ const fn CMSG_ALIGN ( len : usize ) -> usize {
1516
+ len + size_of :: < usize > ( ) - 1 & !( size_of :: < usize > ( ) - 1 )
1519
1517
}
1520
1518
1521
1519
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 @@ -1821,10 +1821,8 @@ cfg_if! {
1821
1821
}
1822
1822
}
1823
1823
1824
- const_fn ! {
1825
- const fn CMSG_ALIGN ( len: usize ) -> usize {
1826
- ( len + size_of:: <usize >( ) - 1 ) & !( size_of:: <usize >( ) - 1 )
1827
- }
1824
+ const fn CMSG_ALIGN ( len : usize ) -> usize {
1825
+ ( len + size_of :: < usize > ( ) - 1 ) & !( size_of :: < usize > ( ) - 1 )
1828
1826
}
1829
1827
1830
1828
f ! {
Original file line number Diff line number Diff line change @@ -2606,14 +2606,12 @@ pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
2606
2606
__spare : 0 ,
2607
2607
} ;
2608
2608
2609
- const_fn ! {
2610
- const fn _CMSG_ALIGN( len: usize ) -> usize {
2611
- len + size_of:: <usize >( ) - 1 & !( size_of:: <usize >( ) - 1 )
2612
- }
2609
+ const fn _CMSG_ALIGN ( len : usize ) -> usize {
2610
+ len + size_of :: < usize > ( ) - 1 & !( size_of :: < usize > ( ) - 1 )
2611
+ }
2613
2612
2614
- const fn _ALIGN( p: usize , b: usize ) -> usize {
2615
- ( p + b - 1 ) & !( b - 1 )
2616
- }
2613
+ const fn _ALIGN ( p : usize , b : usize ) -> usize {
2614
+ ( p + b - 1 ) & !( b - 1 )
2617
2615
}
2618
2616
2619
2617
f ! {
You can’t perform that action at this time.
0 commit comments