Skip to content

Error if the wrong architecture is being used #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down