You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use std::env;
use std::path::PathBuf;
use glob::glob;
fn main() {
let mut cfg = cc::Build::new();
cfg.include("../phlib/include")
.include("../phnt/include")
.include("../kphlib/include") // kphapi.h
.cpp(true)
.define("BUILDING_PHLIB", "1") // Define macro to fix dllimport/export
.flag("-wd4706") // Suppress assignment warnings
.flag("-wd4273") // Suppress inconsistent DLL linkage warnings
.flag("-wd4013") // Suppress undefined function warnings
.flag_if_supported("/std:c++17"); // Enable C++17
for entry in glob("../phlib/*.c").unwrap() {
cfg.file(entry.unwrap());
}
for entry in glob("../phlib/*.cpp").unwrap() {
cfg.file(entry.unwrap());
}
cfg.compile("phlib");
let bindings = bindgen::Builder::default()
.header("../phlib/include/ph.h")
.clang_arg("-I../phlib/include")
.clang_arg("-I../phnt/include")
.header("../kphlib/include/kphapi.h")
.blocklist_type("std::vector") // Example: Block problematic type
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.layout_tests(false) // Disable layout tests if they cause issues
.generate_comments(false) // Disable comments if they cause issues
.generate()
.expect("Unable to generate bindings");
let out = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings.write_to_file(out.join("bindings.rs")).unwrap();
}
I'm not using autocxx-bindgen and the panic has been reported before in #2325 I'm not sure how to proceed this is my first bindgen of my own authorship.
I will look into creduce on my mac (nvm this is windows only..I will look into this though.) and see what that helps. above is the code; i decided to work on a separate c binary since I couldnt get the bindgen to work. would love to continue work on the sys. find phlib-sys in toplevel and env_search is my attempt reading env of other processes. which is giving me access violation; if anyone has any ideas on that.. i would appreciate. I see systeminformer perform this feat; so I know its possible.
Uh oh!
There was an error while loading. Please reload this page.
Ran into this the issue this evening.
https://processhacker.sourceforge.io/doc/native_8c_source.html#l01353
https://github.com/winsiderss/systeminformer/tree/master
I am trying to write a wrapper for phlib.
I'm not using autocxx-bindgen and the panic has been reported before in #2325 I'm not sure how to proceed this is my first bindgen of my own authorship.
also here: TheButlah/ovr_overlay#24
The text was updated successfully, but these errors were encountered: