Skip to content

Commit cfcf6f1

Browse files
committed
linux: Switch from glob exports to select imports
Match Apple to make it more clear what headers we want to map.
1 parent a3b1bc6 commit cfcf6f1

File tree

7 files changed

+20
-13
lines changed

7 files changed

+20
-13
lines changed

src/new/linux_uapi/linux/can.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ pub(crate) mod bcm;
44
pub(crate) mod j1939;
55
pub(crate) mod raw;
66

7-
pub use bcm::*;
8-
pub use j1939::*;
9-
pub use raw::*;
10-
117
use crate::prelude::*;
128

139
pub const CAN_EFF_FLAG: canid_t = 0x80000000;

src/new/linux_uapi/linux/can/bcm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! `linux/can/bcm.h`
1+
//! Header: `linux/can/bcm.h`
22
33
pub use crate::linux::can::*;
44

src/new/linux_uapi/linux/can/raw.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! `linux/can/raw.h`
1+
//! Header: `linux/can/raw.h`
22
33
pub use crate::linux::can::*;
44

src/new/linux_uapi/linux/keyctl.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
//! Header: `uapi/linux/keyctl.h`
1+
//! Header: `linux/keyctl.h`
22
3-
// linux/keyctl.h
43
pub const KEY_SPEC_THREAD_KEYRING: i32 = -1;
54
pub const KEY_SPEC_PROCESS_KEYRING: i32 = -2;
65
pub const KEY_SPEC_SESSION_KEYRING: i32 = -3;

src/new/linux_uapi/linux/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
//! The `linux` directory within `include/uapi` in the Linux source tree.
1+
//! Directory: `linux/`
2+
//!
3+
//! <https://github.com/torvalds/linux/tree/master/include/uapi/linux>
24
35
pub(crate) mod can;
4-
pub use can::*;
56
pub(crate) mod keyctl;
6-
pub use keyctl::*;

src/new/linux_uapi/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
//! This directory maps to `include/uapi` in the Linux source tree.
22
33
pub(crate) mod linux;
4-
pub use linux::*;

src/new/mod.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,29 @@
1414
//!
1515
//! All modules are only crate-public since we don't reexport this structure.
1616

17+
// Libraries available on each platform
1718
cfg_if! {
1819
if #[cfg(target_os = "linux")] {
1920
mod linux_uapi;
20-
pub use linux_uapi::*;
21+
pub(crate) use linux_uapi::*;
2122
} else if #[cfg(target_os = "android")] {
2223
mod bionic;
2324
pub use bionic::*;
2425
} else if #[cfg(target_vendor = "apple")] {
2526
mod apple;
2627
pub(crate) use apple::*;
28+
}
29+
}
30+
31+
// Headers we export
32+
cfg_if! {
33+
if #[cfg(target_os = "linux")] {
34+
pub use linux::can::bcm::*;
35+
pub use linux::can::j1939::*;
36+
pub use linux::can::raw::*;
37+
pub use linux::can::*;
38+
pub use linux::keyctl::*;
39+
} else if #[cfg(target_vendor = "apple")] {
2740
pub use signal::*;
2841
}
2942
}

0 commit comments

Comments
 (0)