#[macro_export]
macro_rules! entry {
($($entry:ident => $body:stmt;)*) => {
$(
$crate::entry!(@internal $entry $body);
)*
};
(@internal initialize $body:stmt) => {
#[inline]
#[no_mangle]
unsafe extern "C" fn initialize() {
$body
}
};
(@internal opcontrol $body:stmt) => {
#[inline]
#[no_mangle]
unsafe extern "C" fn opcontrol() {
$body
}
};
(@internal autonomous $body:stmt) => {
#[inline]
#[no_mangle]
unsafe extern "C" fn autonomous() {
$body
}
};
(@internal disabled $body:stmt) => {
#[inline]
#[no_mangle]
unsafe extern "C" fn disabled() {
$body
}
};
(@internal $invalid:ident $body:stmt) => {
compile_error!(concat!("entry macro error: entrypoint `", stringify!($invalid), "` does not exist"));
};
}