ittapi_sys/
lib.rs

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