qemu/subprojects
Junjie Mao f351840088 rust: introduce alternative implementation of offset_of!
offset_of! was stabilized in Rust 1.77.0.  Use an alternative implemenation
that was found on the Rust forums, and whose author agreed to license as
MIT for use in QEMU.

The alternative allows only one level of field access, but apart
from this can be used just by replacing core::mem::offset_of! with
qemu_api::offset_of!.

The actual implementation of offset_of! is done in a declarative macro,
but for simplicity and to avoid introducing an extra level of indentation,
the trigger is a procedural macro #[derive(offsets)].

The procedural macro is perhaps a bit overengineered, but it helps
introducing some idioms that will be useful in the future as well.

Signed-off-by: Junjie Mao <junjie.mao@hotmail.com>
Co-developed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-11-05 14:18:16 +01:00
..
libvduse libvduse: Fix compiler warning with -Wshadow=local 2023-10-12 14:09:58 +02:00
libvhost-user libvhost-user: mask F_INFLIGHT_SHMFD if memfd is not supported 2024-07-02 09:27:56 -04:00
packagefiles rust: introduce alternative implementation of offset_of! 2024-11-05 14:18:16 +01:00
unicode-ident-1-rs rust: add utility procedural macro crate 2024-10-11 12:32:17 +02:00
.gitignore rust: add PL011 device model 2024-11-05 14:18:15 +01:00
arbitrary-int-1-rs.wrap rust: add PL011 device model 2024-11-05 14:18:15 +01:00
berkeley-softfloat-3.wrap subprojects: Use the correct .git suffix in the repository URLs 2023-09-21 11:31:18 +03:00
berkeley-testfloat-3.wrap subprojects: Use the correct .git suffix in the repository URLs 2023-09-21 11:31:18 +03:00
bilge-0.2-rs.wrap rust: add PL011 device model 2024-11-05 14:18:15 +01:00
bilge-impl-0.2-rs.wrap rust: patch bilge-impl to allow compilation with 1.63.0 2024-11-05 14:18:16 +01:00
dtc.wrap meson: subprojects: replace submodules with wrap files 2023-06-06 16:30:01 +02:00
either-1-rs.wrap rust: add PL011 device model 2024-11-05 14:18:15 +01:00
itertools-0.11-rs.wrap rust: add PL011 device model 2024-11-05 14:18:15 +01:00
keycodemapdb.wrap meson: subprojects: replace submodules with wrap files 2023-06-06 16:30:01 +02:00
libblkio.wrap subprojects: add wrap file for libblkio 2023-09-07 13:32:37 +02:00
libvfio-user.wrap meson: subprojects: replace submodules with wrap files 2023-06-06 16:30:01 +02:00
proc-macro2-1-rs.wrap rust: add utility procedural macro crate 2024-10-11 12:32:17 +02:00
proc-macro-error-1-rs.wrap rust: add PL011 device model 2024-11-05 14:18:15 +01:00
proc-macro-error-attr-1-rs.wrap rust: add PL011 device model 2024-11-05 14:18:15 +01:00
quote-1-rs.wrap rust: add utility procedural macro crate 2024-10-11 12:32:17 +02:00
slirp.wrap subprojects: Use the correct .git suffix in the repository URLs 2023-09-21 11:31:18 +03:00
syn-2-rs.wrap rust: add utility procedural macro crate 2024-10-11 12:32:17 +02:00
unicode-ident-1-rs.wrap rust: add utility procedural macro crate 2024-10-11 12:32:17 +02:00