cbindgen
This commit is contained in:
parent
cd1d84b25d
commit
4cfb0b30d6
7
build.rs
7
build.rs
|
@ -7,16 +7,13 @@ fn main() {
|
|||
)
|
||||
.unwrap();
|
||||
|
||||
// create_c_bindings();
|
||||
create_c_bindings();
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn create_c_bindings() {
|
||||
let crate_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
|
||||
let config = cbindgen::Config {
|
||||
language: cbindgen::Language::C,
|
||||
..Default::default()
|
||||
};
|
||||
let config = cbindgen::Config::from_root_or_default(".");
|
||||
|
||||
cbindgen::Builder::new()
|
||||
.with_crate(crate_dir)
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
language = "C"
|
||||
no_includes = true
|
||||
after_includes = """
|
||||
typedef char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef short int uint16_t;
|
||||
typedef long long int int64_t;
|
||||
typedef long long int uint64_t;
|
||||
typedef long long int uintptr_t;
|
||||
typedef long int int32_t;
|
||||
typedef long int uint32_t;
|
||||
#ifndef __cplusplus
|
||||
typedef char bool;
|
||||
#endif
|
||||
typedef void *DartPostCObjectFnType;
|
||||
"""
|
Loading…
Reference in New Issue