File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -359,6 +359,14 @@ cfg_if! {
359359 }
360360}
361361
362+ // Non-public helper constant
363+ #[ cfg( all( not( libc_const_size_of) , target_pointer_width = "32" ) ) ]
364+ const SIZEOF_LONG : usize = 4 ;
365+ #[ cfg( all( not( libc_const_size_of) , target_pointer_width = "64" ) ) ]
366+ const SIZEOF_LONG : usize = 8 ;
367+ #[ cfg( libc_const_size_of) ]
368+ const SIZEOF_LONG : usize = :: mem:: size_of :: < :: c_long > ( ) ;
369+
362370#[ deprecated(
363371 since = "0.2.64" ,
364372 note = "Can vary at runtime. Use sysconf(3) instead"
@@ -1216,8 +1224,7 @@ pub const ONLRET: ::tcflag_t = 0x40;
12161224pub const CMGROUP_MAX : usize = 16 ;
12171225
12181226// https://github.com/freebsd/freebsd/blob/master/sys/net/bpf.h
1219- // sizeof(long)
1220- pub const BPF_ALIGNMENT : :: c_int = 8 ;
1227+ pub const BPF_ALIGNMENT : usize = SIZEOF_LONG ;
12211228
12221229// Values for rtprio struct (prio field) and syscall (function argument)
12231230pub const RTP_PRIO_MIN : :: c_ushort = 0 ;
You can’t perform that action at this time.
0 commit comments