Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 10:29:08 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions

26
vendor/bevy_derive/src/bevy_main.rs vendored Normal file
View File

@@ -0,0 +1,26 @@
use proc_macro::TokenStream;
use quote::quote;
use syn::{parse_macro_input, ItemFn};
pub fn bevy_main(_attr: TokenStream, item: TokenStream) -> TokenStream {
let input = parse_macro_input!(item as ItemFn);
assert_eq!(
input.sig.ident, "main",
"`bevy_main` can only be used on a function called 'main'."
);
TokenStream::from(quote! {
// SAFETY: `#[bevy_main]` should only be placed on a single `main` function
// TODO: Potentially make `bevy_main` and unsafe attribute as there is a safety
// guarantee required from the caller.
#[unsafe(no_mangle)]
#[cfg(target_os = "android")]
fn android_main(android_app: bevy::window::android_activity::AndroidApp) {
let _ = bevy::window::ANDROID_APP.set(android_app);
main();
}
#[allow(unused)]
#input
})
}