1#![doc = "README.md"]
2#![feature(stdarch_internal)]
3#![allow(internal_features)]
4#![cfg_attr(not(test), no_main)]
5#![cfg_attr(test, allow(dead_code))]
6
7mod build;
8
9use build::{Build, Executable};
10
11#[unsafe(no_mangle)]
30#[cfg(not(test))]
31pub unsafe extern "C" fn main(argc: i32, argv: *const *const i8, envp: *const *const i8) {
32 let result = unsafe { run(argc, argv, envp) };
33
34 proc_exit::exit(result);
35}
36
37unsafe fn run(argc: i32, argv: *const *const i8, envp: *const *const i8) -> proc_exit::ExitResult {
38 let build = Build::find().unwrap_or_default();
39
40 unsafe { build.exec(argc, argv, envp) }?;
41
42 Ok(())
43}