rust-vmm / vmm-sys-util

Helpers and utilities used by multiple rust-vmm components and VMMs
BSD 3-Clause "New" or "Revised" License
78 stars 64 forks source link

fix: make ioctl macro expand hygienically #211

Closed roypat closed 7 months ago

roypat commented 9 months ago

Summary of the PR

The ioctl_io*_nr macros expand to blocks that again contain macros. However, when doing this, the expanded code did not use $crate, meaning those submacros had to be in-scope at the call site. This could cause surpising compilation failures if macros were not imported, but rather referred to by their full name (e.g. vmm-sys-utils::ioctls::ioctl_iow_nr!).

Requirements

Before submitting your PR, please make sure you addressed the following requirements: