From 090d25168a8ef4cb48d3b1c738b3d2e946d90bbe Mon Sep 17 00:00:00 2001 From: Nils Husung Date: Fri, 23 Feb 2024 22:56:01 +0100 Subject: [PATCH 1/2] Adjust cbindgen overrides --- src/module_writer.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/module_writer.rs b/src/module_writer.rs index 6948dc3b5..f322ba3d3 100644 --- a/src/module_writer.rs +++ b/src/module_writer.rs @@ -544,18 +544,24 @@ fn cffi_header(crate_dir: &Path, target_dir: &Path, tempdir: &TempDir) -> Result } else { if crate_dir.join("cbindgen.toml").is_file() { eprintln!( - "💼 Using the existing cbindgen.toml configuration. \n\ - 💼 Enforcing the following settings: \n \ + "💼 Using the existing cbindgen.toml configuration.\n\ + 💼 Enforcing the following settings:\n \ - language = \"C\" \n \ - - no_includes = true \n \ - - no include_guard \t (directives are not yet supported) \n \ - - no defines \t (directives are not yet supported)" + - no_includes = true, sys_includes = []\n \ + (#include is not yet supported by CFFI)\n \ + - defines = [], no include_guard, pragma_once = false, cpp_compat = false\n \ + (#define, #ifdef, etc. is not yet supported by CFFI)\n" ); } let mut config = cbindgen::Config::from_root_or_default(crate_dir); + config.language = cbindgen::Language::C; + config.no_includes = true; + config.sys_includes = Vec::new(); config.defines = HashMap::new(); config.include_guard = None; + config.pragma_once = false; + config.cpp_compat = false; let bindings = cbindgen::Builder::new() .with_config(config) From ac840e694ad0b9c2ad6484b0c8bffca76f741619 Mon Sep 17 00:00:00 2001 From: konsti Date: Wed, 28 Feb 2024 21:01:31 +0100 Subject: [PATCH 2/2] Phrasing --- src/module_writer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module_writer.rs b/src/module_writer.rs index f322ba3d3..cc5aa9504 100644 --- a/src/module_writer.rs +++ b/src/module_writer.rs @@ -549,7 +549,7 @@ fn cffi_header(crate_dir: &Path, target_dir: &Path, tempdir: &TempDir) -> Result - language = \"C\" \n \ - no_includes = true, sys_includes = []\n \ (#include is not yet supported by CFFI)\n \ - - defines = [], no include_guard, pragma_once = false, cpp_compat = false\n \ + - defines = [], include_guard = None, pragma_once = false, cpp_compat = false\n \ (#define, #ifdef, etc. is not yet supported by CFFI)\n" ); }