Skip to content

Commit 86e3d3b

Browse files
committed
refactor: annotate RAND_MAX unstable in FreeBSD
This symbol has been modified in the last few versions of FreeBSD. It can possibly be assumed that the constant is likely to change upstream, and users should likely be advised of its use. The link in the doc comment is broken until #5179 gets merged.
1 parent 8372b50 commit 86e3d3b

5 files changed

Lines changed: 21 additions & 5 deletions

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,11 @@ s! {
259259
}
260260

261261
pub const ELAST: c_int = 96;
262-
pub const RAND_MAX: c_int = 0x7fff_fffd;
262+
263+
ct! {
264+
pub const RAND_MAX: c_int = 0x7fff_fffd;
265+
}
266+
263267
pub const KI_NSPARE_PTR: usize = 6;
264268
pub const MINCORE_SUPER: c_int = 0x20;
265269
/// max length of devicename

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,10 @@ s! {
303303
}
304304
}
305305

306-
pub const RAND_MAX: c_int = 0x7fff_fffd;
306+
ct! {
307+
pub const RAND_MAX: c_int = 0x7fff_fffd;
308+
}
309+
307310
pub const ELAST: c_int = 97;
308311

309312
/// max length of devicename

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,10 @@ s! {
316316
}
317317
}
318318

319-
pub const RAND_MAX: c_int = 0x7fff_ffff;
319+
ct! {
320+
pub const RAND_MAX: c_int = 0x7fff_ffff;
321+
}
322+
320323
pub const ELAST: c_int = 97;
321324

322325
pub const KF_TYPE_EVENTFD: c_int = 13;

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,10 @@ s! {
318318
}
319319
}
320320

321-
pub const RAND_MAX: c_int = 0x7fff_ffff;
321+
ct! {
322+
pub const RAND_MAX: c_int = 0x7fff_ffff;
323+
}
324+
322325
pub const ELAST: c_int = 97;
323326

324327
pub const KF_TYPE_EVENTFD: c_int = 13;

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,10 @@ s! {
320320
}
321321
}
322322

323-
pub const RAND_MAX: c_int = 0x7fff_ffff;
323+
ct! {
324+
pub const RAND_MAX: c_int = 0x7fff_ffff;
325+
}
326+
324327
pub const ELAST: c_int = 97;
325328

326329
pub const KF_TYPE_EVENTFD: c_int = 13;

0 commit comments

Comments
 (0)