mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-01 06:21:52 -06:00
rust: introduce a c_str macro
This allows CStr constants to be defined easily on Rust 1.63.0, while checking that there are no embedded NULs. c"" literals were only stabilized in Rust 1.77.0. Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
9f7d4520d6
commit
718e255f0a
8 changed files with 78 additions and 19 deletions
|
@ -42,12 +42,14 @@ extern crate bilge;
|
|||
extern crate bilge_impl;
|
||||
extern crate qemu_api;
|
||||
|
||||
use qemu_api::c_str;
|
||||
|
||||
pub mod device;
|
||||
pub mod device_class;
|
||||
pub mod memory_ops;
|
||||
|
||||
pub const TYPE_PL011: &::std::ffi::CStr = c"pl011";
|
||||
pub const TYPE_PL011_LUMINARY: &::std::ffi::CStr = c"pl011_luminary";
|
||||
pub const TYPE_PL011: &::std::ffi::CStr = c_str!("pl011");
|
||||
pub const TYPE_PL011_LUMINARY: &::std::ffi::CStr = c_str!("pl011_luminary");
|
||||
|
||||
/// Offset of each register from the base memory address of the device.
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue