Skip to content

Commit 13fa8b2

Browse files
committed
Deprecate constants removed in FreeBSD 11 and hide it from docs
This also tests some sighandler_t and MS_ constants on FreeBSD.
1 parent f47e6d6 commit 13fa8b2

File tree

5 files changed

+26
-20
lines changed

5 files changed

+26
-20
lines changed

libc-test/build.rs

-18
Original file line numberDiff line numberDiff line change
@@ -1557,16 +1557,6 @@ fn test_freebsd(target: &str) {
15571557
}
15581558
});
15591559

1560-
cfg.skip_type(move |ty| {
1561-
match ty {
1562-
// sighandler_t is crazy across platforms
1563-
// FIXME: still required?
1564-
"sighandler_t" => true,
1565-
1566-
_ => false,
1567-
}
1568-
});
1569-
15701560
cfg.skip_struct(move |ty| {
15711561
match ty {
15721562
// This is actually a union, not a struct
@@ -1598,14 +1588,6 @@ fn test_freebsd(target: &str) {
15981588
match name {
15991589
// FIXME: still required?
16001590
"SIG_DFL" | "SIG_ERR" | "SIG_IGN" => true, // sighandler_t weirdness
1601-
// FIXME: still required?
1602-
"SIGUNUSED" => true, // removed in glibc 2.26
1603-
1604-
// weird signed extension or something like that?
1605-
// FIXME: still required?
1606-
"MS_NOUSER" => true,
1607-
// FIXME: still required?
1608-
"MS_RMT_MASK" => true, // updated in glibc 2.22 and musl 1.1.13
16091591

16101592
// These constants were removed in FreeBSD 11 (svn r273250) but will
16111593
// still be accepted and ignored at runtime.

src/unix/bsd/apple/mod.rs

+7
Original file line numberDiff line numberDiff line change
@@ -2419,13 +2419,15 @@ pub const NOTE_NONE: ::uint32_t = 0x00000080;
24192419
pub const NOTE_EXIT: ::uint32_t = 0x80000000;
24202420
pub const NOTE_FORK: ::uint32_t = 0x40000000;
24212421
pub const NOTE_EXEC: ::uint32_t = 0x20000000;
2422+
#[doc(hidden)]
24222423
#[deprecated(since="0.2.49", note="Deprecated since MacOSX 10.9")]
24232424
pub const NOTE_REAP: ::uint32_t = 0x10000000;
24242425
pub const NOTE_SIGNAL: ::uint32_t = 0x08000000;
24252426
pub const NOTE_EXITSTATUS: ::uint32_t = 0x04000000;
24262427
pub const NOTE_EXIT_DETAIL: ::uint32_t = 0x02000000;
24272428
pub const NOTE_PDATAMASK: ::uint32_t = 0x000fffff;
24282429
pub const NOTE_PCTRLMASK: ::uint32_t = 0xfff00000;
2430+
#[doc(hidden)]
24292431
#[deprecated(since="0.2.49", note="Deprecated since MacOSX 10.9")]
24302432
pub const NOTE_EXIT_REPARENTED: ::uint32_t = 0x00080000;
24312433
pub const NOTE_EXIT_DETAIL_MASK: ::uint32_t = 0x00070000;
@@ -2632,8 +2634,10 @@ pub const KERN_KDSETRTCDEC: ::c_int = 15;
26322634
pub const KERN_KDGETENTROPY: ::c_int = 16;
26332635
pub const KERN_KDWRITETR: ::c_int = 17;
26342636
pub const KERN_KDWRITEMAP: ::c_int = 18;
2637+
#[doc(hidden)]
26352638
#[deprecated(since = "0.2.49", note ="Removed in MacOSX 10.12")]
26362639
pub const KERN_KDENABLE_BG_TRACE: ::c_int = 19;
2640+
#[doc(hidden)]
26372641
#[deprecated(since = "0.2.49", note ="Removed in MacOSX 10.12")]
26382642
pub const KERN_KDDISABLE_BG_TRACE: ::c_int = 20;
26392643
pub const KERN_KDREADCURTHRMAP: ::c_int = 21;
@@ -3014,11 +3018,14 @@ f! {
30143018
}
30153019

30163020
extern {
3021+
#[doc(hidden)]
30173022
#[deprecated(since="0.2.49", note="Deprecated in MacOSX 10.5")]
30183023
#[link_name = "daemon$1050"]
30193024
pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
3025+
#[doc(hidden)]
30203026
#[deprecated(since="0.2.49", note="Deprecated in MacOSX 10.10")]
30213027
pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
3028+
#[doc(hidden)]
30223029
#[deprecated(since="0.2.49", note="Deprecated in MacOSX 10.10")]
30233030
pub fn sem_init(sem: *mut sem_t,
30243031
pshared: ::c_int,

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

+14-2
Original file line numberDiff line numberDiff line change
@@ -779,14 +779,21 @@ pub const IFF_POINTOPOINT: ::c_int = 0x10; // (i) is a point-to-point link
779779
// 0x20 was IFF_SMART
780780
pub const IFF_RUNNING: ::c_int = 0x40; // (d) resources allocated
781781
#[doc(hidden)]
782-
// IFF_DRV_RUNNING is deprecated. Use the portable `IFF_RUNNING` instead
782+
#[doc(hidden)]
783+
#[deprecated(
784+
since="0.2.54",
785+
note="IFF_DRV_RUNNING is deprecated. Use the portable IFF_RUNNING instead"
786+
)]
783787
pub const IFF_DRV_RUNNING: ::c_int = 0x40;
784788
pub const IFF_NOARP: ::c_int = 0x80; // (n) no address resolution protocol
785789
pub const IFF_PROMISC: ::c_int = 0x100; // (n) receive all packets
786790
pub const IFF_ALLMULTI: ::c_int = 0x200; // (n) receive all multicast packets
787791
pub const IFF_OACTIVE: ::c_int = 0x400; // (d) tx hardware queue is full
788792
#[doc(hidden)]
789-
// IFF_DRV_OACTIVE is deprecated. Use the portable `IFF_OACTIVE` instead
793+
#[deprecated(
794+
since="0.2.54",
795+
note="IFF_DRV_OACTIVE is deprecated. Use the portable `IFF_OACTIVE` instead",
796+
)]
790797
pub const IFF_DRV_OACTIVE: ::c_int = 0x400;
791798
pub const IFF_SIMPLEX: ::c_int = 0x800; // (i) can't hear own transmissions
792799
pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
@@ -1106,14 +1113,19 @@ pub const SHM_ANON: *mut ::c_char = 1 as *mut ::c_char;
11061113
// they were all removed in svn r262489. They remain here for backwards
11071114
// compatibility only, and are scheduled to be removed in libc 1.0.0.
11081115
#[doc(hidden)]
1116+
#[deprecated(since="0.2.54",note="Removed in FreeBSD 11")]
11091117
pub const NET_MAXID: ::c_int = AF_MAX;
11101118
#[doc(hidden)]
1119+
#[deprecated(since="0.2.54",note="Removed in FreeBSD 11")]
11111120
pub const CTL_MAXID: ::c_int = 10;
11121121
#[doc(hidden)]
1122+
#[deprecated(since="0.2.54",note="Removed in FreeBSD 11")]
11131123
pub const KERN_MAXID: ::c_int = 38;
11141124
#[doc(hidden)]
1125+
#[deprecated(since="0.2.54",note="Removed in FreeBSD 11")]
11151126
pub const HW_MAXID: ::c_int = 13;
11161127
#[doc(hidden)]
1128+
#[deprecated(since="0.2.54",note="Removed in FreeBSD 11")]
11171129
pub const USER_MAXID: ::c_int = 21;
11181130
#[doc(hidden)]
11191131
pub const CTL_P1003_1B_MAXID: ::c_int = 26;

src/unix/bsd/freebsdlike/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,11 @@ pub const LOCK_NB: ::c_int = 4;
758758
pub const LOCK_UN: ::c_int = 8;
759759

760760
pub const MAP_COPY: ::c_int = 0x0002;
761+
#[doc(hidden)]
762+
#[deprecated(since="0.2.54",note="Removed in FreeBSD 11")]
761763
pub const MAP_RENAME: ::c_int = 0x0020;
764+
#[doc(hidden)]
765+
#[deprecated(since="0.2.54",note="Removed in FreeBSD 11")]
762766
pub const MAP_NORESERVE: ::c_int = 0x0040;
763767
pub const MAP_HASSEMAPHORE: ::c_int = 0x0200;
764768
pub const MAP_STACK: ::c_int = 0x0400;

src/unix/notbsd/linux/other/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ s! {
4848
pub si_signo: ::c_int,
4949
pub si_errno: ::c_int,
5050
pub si_code: ::c_int,
51+
#[doc(hidden)]
5152
#[deprecated(
5253
since="0.2.54",
5354
note="Please leave a comment on \

0 commit comments

Comments
 (0)