Skip to content

Commit 71420d4

Browse files
committed
Auto merge of #3241 - jmillikin:cmsg-macros-const-usize, r=JohnTitor
Constify `CMSG_LEN` for all targets.
2 parents 3b5109b + dbae373 commit 71420d4

File tree

12 files changed

+12
-12
lines changed

12 files changed

+12
-12
lines changed

src/fuchsia/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3271,7 +3271,7 @@ f! {
32713271
as ::c_uint
32723272
}
32733273

3274-
pub fn CMSG_LEN(len: ::c_uint) -> ::c_uint {
3274+
pub {const} fn CMSG_LEN(len: ::c_uint) -> ::c_uint {
32753275
(CMSG_ALIGN(::mem::size_of::<cmsghdr>()) + len as ::size_t) as ::c_uint
32763276
}
32773277
}

src/unix/aix/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2551,7 +2551,7 @@ f! {
25512551
(cmsg as *mut ::c_uchar).offset(::mem::size_of::<::cmsghdr>() as isize)
25522552
}
25532553

2554-
pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
2554+
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
25552555
::mem::size_of::<::cmsghdr>() as ::c_uint + length
25562556
}
25572557

src/unix/bsd/apple/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5107,7 +5107,7 @@ f! {
51075107
as ::c_uint
51085108
}
51095109

5110-
pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
5110+
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
51115111
(__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) + length as usize)
51125112
as ::c_uint
51135113
}

src/unix/bsd/freebsdlike/dragonfly/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1534,7 +1534,7 @@ f! {
15341534
.offset(_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
15351535
}
15361536

1537-
pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
1537+
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
15381538
(_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) + length as usize)
15391539
as ::c_uint
15401540
}

src/unix/bsd/freebsdlike/freebsd/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4717,7 +4717,7 @@ f! {
47174717
.offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
47184718
}
47194719

4720-
pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
4720+
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
47214721
_ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
47224722
}
47234723

src/unix/bsd/netbsdlike/netbsd/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2422,7 +2422,7 @@ f! {
24222422
.offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
24232423
}
24242424

2425-
pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
2425+
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
24262426
_ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
24272427
}
24282428

src/unix/bsd/netbsdlike/openbsd/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1705,7 +1705,7 @@ f! {
17051705
.offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
17061706
}
17071707

1708-
pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
1708+
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
17091709
_ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
17101710
}
17111711

src/unix/haiku/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1504,7 +1504,7 @@ f! {
15041504
as ::c_uint
15051505
}
15061506

1507-
pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
1507+
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
15081508
CMSG_ALIGN(::mem::size_of::<cmsghdr>()) as ::c_uint + length
15091509
}
15101510

src/unix/linux_like/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1557,7 +1557,7 @@ f! {
15571557
as ::c_uint
15581558
}
15591559

1560-
pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
1560+
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
15611561
CMSG_ALIGN(::mem::size_of::<cmsghdr>()) as ::c_uint + length
15621562
}
15631563

src/unix/nto/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2539,7 +2539,7 @@ f! {
25392539
.offset(_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
25402540
}
25412541

2542-
pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
2542+
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
25432543
_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
25442544
}
25452545

src/unix/solarish/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2601,7 +2601,7 @@ f! {
26012601
_CMSG_DATA_ALIGN(cmsg.offset(1) as usize) as *mut ::c_uchar
26022602
}
26032603

2604-
pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
2604+
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
26052605
_CMSG_DATA_ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
26062606
}
26072607

src/vxworks/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ f! {
10721072
as ::c_uint
10731073
}
10741074

1075-
pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
1075+
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
10761076
CMSG_ALIGN(::mem::size_of::<cmsghdr>()) as ::c_uint + length
10771077
}
10781078
}

0 commit comments

Comments
 (0)