ittapi_sys/
lib.rs

1//! This library contains OS-specific bindings to the C `ittapi` library.
2#![allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
3#![allow(unused)]
4#![deny(clippy::all)]
5#![warn(clippy::pedantic)]
6#![warn(clippy::cargo)]
7#![allow(clippy::unreadable_literal)]
8
9// The ITT bindings are OS-specific: they contain OS-specific constants (e.g. `ITT_OS` and
10// `ITT_PLATFORM`) and some of the Windows structure sizes are different. Because of this, we
11// generate bindings separately for each OS. TODO handle unsupported OSes gracefully here.
12#[cfg(target_os = "linux")]
13include!("linux/ittnotify_bindings.rs");
14#[cfg(target_os = "macos")]
15include!("macos/ittnotify_bindings.rs");
16#[cfg(target_os = "windows")]
17include!("windows/ittnotify_bindings.rs");
18#[cfg(target_os = "freebsd")]
19include!("freebsd/ittnotify_bindings.rs");
20#[cfg(target_os = "openbsd")]
21include!("openbsd/ittnotify_bindings.rs");
22
23// The JIT profiling bindings are almost OS-agnostic, but slight differences with `c_uint` vs
24// `c_int`, e.g., force us to use separate bindings.
25#[cfg(target_os = "linux")]
26include!("linux/jitprofiling_bindings.rs");
27#[cfg(target_os = "macos")]
28include!("macos/jitprofiling_bindings.rs");
29#[cfg(target_os = "windows")]
30include!("windows/jitprofiling_bindings.rs");
31#[cfg(target_os = "freebsd")]
32include!("freebsd/jitprofiling_bindings.rs");
33#[cfg(target_os = "openbsd")]
34include!("openbsd/jitprofiling_bindings.rs");
35
36// #[link(name = "ittnotify", kind = "static")]
37// extern "C" {
38//     #[link_name = "__itt_domain_create_init_3_0"]
39//     pub fn __itt_domain_create_init_3_0(name: *const std::os::raw::c_char) -> *mut __itt_domain;
40//     // #[link_name = "__itt_domain_create_init_3_0"]
41//     // pub fn __itt_domain_create(name: *const std::os::raw::c_char) -> *mut __itt_domain;
42// }