[][src]Attribute Macro gba_proc_macro::entry

#[entry]

Attribute to declare the entry point of the program.

IMPORTANT: This attribute must appear exactly once in the dependency graph. Also, if you are using Rust 1.30 the attribute must be used on a reachable item (i.e. there must be no private modules between the item and the root of the crate); if the item is in the root of the crate you'll be fine. This reachability restriction doesn't apply to Rust 1.31 onwards.

The specified function will be called by the crt0 after RAM has been initialized. It must take no arguments, and must be divergent (in other words, its type must be either fn() -> ! or unsafe fn() -> !). The program can't reference the entry point, much less invoke it.

Example

#[entry]
fn main() -> ! {
    loop {
        /* .. */
    }
}