Skip to content

Commit

Permalink
Allow import of Linux macros in Rust2018
Browse files Browse the repository at this point in the history
Finish off the work started in 8c9ac5a allowing the use of macros
without needing to import local inner macros.
  • Loading branch information
Susurrus committed May 24, 2019
1 parent 4a2fcba commit 1040c6a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sys/ioctl/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ macro_rules! ioc {
/// ioctl_write_int_bad!(kvm_create_vm, request_code_none!(KVMIO, 0x03));
/// # fn main() {}
/// ```
#[macro_export]
#[macro_export(local_inner_macros)]
macro_rules! request_code_none {
($ty:expr, $nr:expr) => (ioc!($crate::sys::ioctl::NONE, $ty, $nr, 0))
}
Expand All @@ -108,7 +108,7 @@ macro_rules! request_code_none {
/// The read/write direction is relative to userland, so this
/// command would be userland is reading and the kernel is
/// writing.
#[macro_export]
#[macro_export(local_inner_macros)]
macro_rules! request_code_read {
($ty:expr, $nr:expr, $sz:expr) => (ioc!($crate::sys::ioctl::READ, $ty, $nr, $sz))
}
Expand All @@ -123,7 +123,7 @@ macro_rules! request_code_read {
/// The read/write direction is relative to userland, so this
/// command would be userland is writing and the kernel is
/// reading.
#[macro_export]
#[macro_export(local_inner_macros)]
macro_rules! request_code_write {
($ty:expr, $nr:expr, $sz:expr) => (ioc!($crate::sys::ioctl::WRITE, $ty, $nr, $sz))
}
Expand All @@ -134,7 +134,7 @@ macro_rules! request_code_write {
///
/// You should only use this macro directly if the `ioctl` you're working
/// with is "bad" and you cannot use `ioctl_readwrite!()` directly.
#[macro_export]
#[macro_export(local_inner_macros)]
macro_rules! request_code_readwrite {
($ty:expr, $nr:expr, $sz:expr) => (ioc!($crate::sys::ioctl::READ | $crate::sys::ioctl::WRITE, $ty, $nr, $sz))
}

0 comments on commit 1040c6a

Please sign in to comment.