rust-bindgen
rust-bindgen copied to clipboard
Allow passing `AsRef<OsStr>` as valid `clang_arg` value.
This allows more easily setting arguments that may come from an OsString like a path from pkg-config
Seems reasonable, would take a patch if it doesn't break backwards compat. Thanks.
I think this interacts poorly with clang because it expects CStrings everywhere. On unix-like platforms this is not an issue as we can turn OsStrings into bytes and then into CStrings without issue. But on windows we cannot do that as we can only get wide slices.
This discussion is adjacent to https://github.com/rust-lang/rust-bindgen/issues/1297 as we need to figure out how to handle lossy conversion between string types. I'm closing this issue as the #1297 has a more developed discussion.