crashpad_sys/
lib.rs

1include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
2
3#[cfg(not(target_os = "windows"))]
4const DEFAULT_HANDLER_NAME: &str = "crashpad_handler";
5#[cfg(target_os = "windows")]
6const DEFAULT_HANDLER_NAME: &str = "crashpad_handler.exe";
7
8#[cfg(all(feature = "with-precompiled", not(target_os = "windows")))]
9const HANDLER: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/bin/crashpad_handler"));
10#[cfg(all(feature = "with-precompiled", target_os = "windows"))]
11const HANDLER: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/bin/crashpad_handler.exe"));
12
13/// The default file name of the Crashpad handler executable binary.
14pub const fn handler_name() -> &'static str {
15    DEFAULT_HANDLER_NAME
16}
17
18/// The data of a precompiled Crashpad handler executable binary.
19///
20/// *This data is available only if this crate is built with the `"with-precompiled"` feature.*
21#[cfg(not(feature = "with-precompiled"))]
22pub const fn precompiled_handler() -> Option<&'static [u8]> {
23    None
24}
25#[cfg(feature = "with-precompiled")]
26pub const fn precompiled_handler() -> Option<&'static [u8]> {
27    Some(HANDLER)
28}