Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/bindgen/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,11 @@ impl Parse {
};

if let syn::Visibility::Public(_) = vis {
if sig.abi.is_omitted() || sig.abi.is_c() {
if let Some(exported_name) = named_symbol.exported_name() {
let is_extern_c = sig.abi.is_omitted() || sig.abi.is_c();
let exported_name = named_symbol.exported_name();

match (is_extern_c, exported_name) {
(true, Some(exported_name)) => {
let path = Path::new(exported_name);
match Function::load(path, self_type, &sig, false, &attrs, mod_cfg) {
Ok(func) => {
Expand All @@ -649,14 +652,17 @@ impl Parse {
error!("Cannot use fn {} ({}).", loggable_item_name(), msg);
}
}
} else {
}
(true, None) => {
warn!(
"Skipping {} - (not `no_mangle`, and has no `export_name` attribute)",
loggable_item_name()
);
}
} else {
warn!("Skipping {} - (not `extern \"C\"`", loggable_item_name());
(false, Some(_exported_name)) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just use (_) or (..), fwiw. But this works for me as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can change it to _ next time :)

warn!("Skipping {} - (not `extern \"C\"`", loggable_item_name());
}
(false, None) => {}
}
} else {
warn!("Skipping {} - (not `pub`)", loggable_item_name());
Expand Down