File tree 1 file changed +9
-2
lines changed 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -359,6 +359,14 @@ cfg_if! {
359
359
}
360
360
}
361
361
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
+
362
370
#[ deprecated(
363
371
since = "0.2.64" ,
364
372
note = "Can vary at runtime. Use sysconf(3) instead"
@@ -1216,8 +1224,7 @@ pub const ONLRET: ::tcflag_t = 0x40;
1216
1224
pub const CMGROUP_MAX : usize = 16 ;
1217
1225
1218
1226
// 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 ;
1221
1228
1222
1229
// Values for rtprio struct (prio field) and syscall (function argument)
1223
1230
pub const RTP_PRIO_MIN : :: c_ushort = 0 ;
You can’t perform that action at this time.
0 commit comments