diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0a2c121..2bccf24 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -60,7 +60,7 @@ jobs: $paths = @( "$env:USERPROFILE\\.cargo\\bin", # Rust "$env:ProgramFiles\\Git\\cmd", # Git - "$env:ProgramFiles\\Git\\bin", # Bash + "$env:ProgramFiles\\Git\\bin" # Bash ) function Log { param([string]$Message, [string]$Level = "INFO") diff --git a/deps/phnt-nightly b/deps/phnt-nightly index e461325..43a21fc 160000 --- a/deps/phnt-nightly +++ b/deps/phnt-nightly @@ -1 +1 @@ -Subproject commit e461325f786cd70b2b0d5ed082357f929e0b2714 +Subproject commit 43a21fc5aed17ec6529946e282c5a33283ff3254 diff --git a/src/build.rs b/src/build.rs index f77a633..2abe780 100644 --- a/src/build.rs +++ b/src/build.rs @@ -154,7 +154,7 @@ mod regen { .type_alias("NTSTATUS") .opaque_type("std::.*") .use_core() - .ctypes_prefix("::core::ffi") + .ctypes_prefix("crate::cty") .parse_callbacks(Box::new(ProcessComments)) .default_enum_style(bindgen::EnumVariation::Rust { non_exhaustive: true, diff --git a/src/cty/mod.rs b/src/cty/mod.rs new file mode 100644 index 0000000..5d4a4b3 --- /dev/null +++ b/src/cty/mod.rs @@ -0,0 +1,27 @@ + +/// A `cty` implementation that always assumes `target_os = "windows"`. +/// Forked from `::core::ffi` +pub type c_void = ::core::ffi::c_void; + + +pub type c_char = i8; // Windows specific +pub type c_schar = i8; +pub type c_uchar = u8; +pub type c_short = i16; +pub type c_ushort = u16; + +pub type c_int = i32; // Windows specific +pub type c_uint = u32; // Windows specific + +pub type c_long = i32; // Windows specific +pub type c_ulong = u32; // Windows specific + +pub type c_longlong = i64; +pub type c_ulonglong = u64; + +pub type c_float = f32; +pub type c_double = f64; + +pub type c_size_t = usize; +pub type c_ssize_t = isize; +pub type c_ptrdiff_t = isize; \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index ae3018b..0666b55 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,8 +21,6 @@ // SOFTWARE. // #![no_std] -#![cfg_attr(docsrs, feature(doc_cfg))] -#![doc = include_str!("../README.md")] #![allow( warnings, unused, @@ -31,6 +29,12 @@ non_upper_case_globals )] +#![cfg_attr(docsrs, feature(doc_cfg))] +#![doc = include_str!("../README.md")] + +/// Re-export custom `cty` implementation for Windows headers +pub mod cty; + /// Bindings for `phnt` (nightly) generated by `bindgen` pub mod ffi { // use vendored bindings