Skip to main content

vhpi_sys/
lib.rs

1#![allow(non_camel_case_types, non_snake_case, non_upper_case_globals)]
2
3use std::ffi::c_char;
4
5#[cfg(feature = "dynamic")]
6#[doc(hidden)]
7pub use vhpi_shim::__link_vhpi_shim;
8
9include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
10
11#[cfg(all(feature = "dynamic", any(windows, target_os = "macos")))]
12pub unsafe fn vhpi_printf_cstr(format: *const c_char, arg: *const c_char) -> ::std::os::raw::c_int {
13    vhpi_shim::vhpi_printf_cstr(format, arg)
14}
15
16#[cfg(not(all(feature = "dynamic", any(windows, target_os = "macos"))))]
17pub unsafe fn vhpi_printf_cstr(format: *const c_char, arg: *const c_char) -> ::std::os::raw::c_int {
18    vhpi_printf(format, arg)
19}
20
21#[cfg(all(feature = "dynamic", any(windows, target_os = "macos")))]
22pub unsafe fn vhpi_assert_cstr(severity: vhpiSeverityT, msg: *mut c_char) -> ::std::os::raw::c_int {
23    vhpi_shim::vhpi_assert_cstr(severity as ::std::os::raw::c_int, msg)
24}
25
26#[cfg(not(all(feature = "dynamic", any(windows, target_os = "macos"))))]
27pub unsafe fn vhpi_assert_cstr(severity: vhpiSeverityT, msg: *mut c_char) -> ::std::os::raw::c_int {
28    vhpi_assert(severity, msg)
29}
30
31#[cfg(all(feature = "dynamic", any(windows, target_os = "macos")))]
32pub unsafe fn vhpi_control1(command: vhpiSimControlT) -> ::std::os::raw::c_int {
33    vhpi_shim::vhpi_control1(command as ::std::os::raw::c_int)
34}
35
36#[cfg(not(all(feature = "dynamic", any(windows, target_os = "macos"))))]
37pub unsafe fn vhpi_control1(command: vhpiSimControlT) -> ::std::os::raw::c_int {
38    vhpi_control(command)
39}