1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#[doc(hidden)]
#[macro_export]
macro_rules! protologic_define_extern
{
    ($vis:vis fn $name:ident ( $( $arg_name:ident : $arg_ty:ty ),* $(,)? ) $( -> $ret_ty:ty )?) =>
    {
        #[cfg(not(feature="mock_protologic"))]
        mod $name {
            #[link(wasm_import_module = "protologic")]
            extern {
                $vis fn $name ( $( $arg_name : $arg_ty ),* ) $( -> $ret_ty )?;
            }
        }

        #[allow(unused)]
        #[cfg(feature = "mock_protologic")]
        mod $name {
            $vis unsafe fn $name ( $( $arg_name : $arg_ty ),* ) $( -> $ret_ty )? { panic!("extern called in test mode!") }
        }

        #[allow(unused_imports)]
        $vis use self::$name::$name;
    }
}

mod lowlevel;

pub mod constants;
pub mod radio;
pub mod wait;
pub mod radar;
pub mod cpu;
pub mod guns;
pub mod debugging;
pub mod missile_launcher;
pub mod maneuvering;
pub mod physics;
pub mod misc;