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
// Copyright 2022 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

cfg_if::cfg_if! {
    if #[cfg(any(target_os = "android", target_os = "linux"))] {
        pub(crate) mod linux;
        use linux as platform;
        pub(crate) use crate::crosvm::sys::linux::{run_config, ExitState};
    } else if #[cfg(windows)] {
        pub(crate) mod windows;
        use windows as platform;
        pub(crate) use windows::ExitState;
        pub(crate) use windows::run_config;
    } else {
        compile_error!("Unsupported platform");
    }
}

pub(crate) use platform::main::cleanup;
pub(crate) use platform::main::error_to_exit_code;
pub(crate) use platform::main::get_library_watcher;
pub(crate) use platform::main::init_log;
pub(crate) use platform::main::run_command;
#[cfg(feature = "sandbox")]
pub(crate) use platform::main::sandbox_lower_token;
pub(crate) use platform::main::start_device;
#[cfg(not(feature = "crash-report"))]
pub(crate) use platform::set_panic_hook;