]> git.ipfire.org Git - thirdparty/qemu.git/commit
rust: add utility procedural macro crate
authorManos Pitsidianakis <manos.pitsidianakis@linaro.org>
Thu, 3 Oct 2024 13:28:50 +0000 (16:28 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 11 Oct 2024 10:32:17 +0000 (12:32 +0200)
commit2b74dd918007d91f5fee94ad0034b5e7a30ed777
tree71c598b2b4150e7e464954a99f14bb7086f026b2
parent474dcfc0ab093043fee9952282bcab5f1dedc43a
rust: add utility procedural macro crate

This commit adds a helper crate library, qemu-api-macros for derive (and
other procedural) macros to be used along qemu-api.

It needs to be a separate library because in Rust, procedural macros, or
macros that can generate arbitrary code, need to be special separate
compilation units.

Only one macro is introduced in this patch, #[derive(Object)]. It
generates a constructor to register a QOM TypeInfo on init and it must
be used on types that implement qemu_api::definitions::ObjectImpl trait.

Reviewed-by: Junjie Mao <junjie.mao@hotmail.com>
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Link: https://lore.kernel.org/r/dd645642406a6dc2060c6f3f17db2bc77ed67b59.1727961605.git.manos.pitsidianakis@linaro.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
19 files changed:
MAINTAINERS
rust/meson.build
rust/qemu-api-macros/Cargo.lock [new file with mode: 0644]
rust/qemu-api-macros/Cargo.toml [new file with mode: 0644]
rust/qemu-api-macros/README.md [new file with mode: 0644]
rust/qemu-api-macros/meson.build [new file with mode: 0644]
rust/qemu-api-macros/src/lib.rs [new file with mode: 0644]
rust/qemu-api/meson.build
scripts/archive-source.sh
scripts/make-release
subprojects/.gitignore
subprojects/packagefiles/proc-macro2-1-rs/meson.build [new file with mode: 0644]
subprojects/packagefiles/quote-1-rs/meson.build [new file with mode: 0644]
subprojects/packagefiles/syn-2-rs/meson.build [new file with mode: 0644]
subprojects/proc-macro2-1-rs.wrap [new file with mode: 0644]
subprojects/quote-1-rs.wrap [new file with mode: 0644]
subprojects/syn-2-rs.wrap [new file with mode: 0644]
subprojects/unicode-ident-1-rs.wrap [new file with mode: 0644]
subprojects/unicode-ident-1-rs/meson.build [new file with mode: 0644]