~ruther/avr-device

91f3ea8a7aae3bbab0b3d424586200c795cb6770 — lights0123 4 years ago 90075ce
Cause an error in the #[entry] macro instead of avr-device
1 files changed, 8 insertions(+), 1 deletions(-)

M macros/src/lib.rs
M macros/src/lib.rs => macros/src/lib.rs +8 -1
@@ 58,7 58,14 @@ pub fn entry(
    let stmts = block.stmts;
    let unsafety = f.sig.unsafety;

    quote::quote!(
    quote::quote! (
        #[cfg(not(any(doc, target_arch = "avr")))]
        compile_error!(
            "Ensure that you are using an AVR target! You may need to change \
       directories or pass a --target flag to cargo. See
       https://github.com/Rahix/avr-device/pull/41 for more details."
        );

        #(#attrs)*
        #[doc(hidden)]
        #[export_name = "main"]

Do not follow this link