summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ir/context.rs23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/ir/context.rs b/src/ir/context.rs
index 127c0a24..384edb95 100644
--- a/src/ir/context.rs
+++ b/src/ir/context.rs
@@ -2166,10 +2166,27 @@ If you encounter an error missing from this list, please file an issue or a PR!"
}
break;
}
- _ => {
+ spelling if !found_namespace_keyword => {
+ // This is _likely_, but not certainly, a macro that's been placed just before
+ // the namespace keyword. Unfortunately, clang tokens don't let us easily see
+ // through the ifdef tokens, so we don't know what this token should really be.
+ // Instead of panicking though, we warn the user that we assumed the token was
+ // blank, and then move on.
+ //
+ // See also https://github.com/rust-lang/rust-bindgen/issues/1676.
+ warn!(
+ "Ignored unknown namespace prefix '{}' at {:?} in {:?}",
+ String::from_utf8_lossy(spelling),
+ token,
+ cursor
+ );
+ }
+ spelling => {
panic!(
- "Unknown token while processing namespace: {:?}",
- token
+ "Unknown token '{}' while processing namespace at {:?} in {:?}",
+ String::from_utf8_lossy(spelling),
+ token,
+ cursor
);
}
}