-
Notifications
You must be signed in to change notification settings - Fork 742
Duplicate definitions for Write1 #2202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Here are the full generated bindings: https://pastebin.com/9mWz1S4j |
This seems to happen because there is a function named Write and a function named Write1 in the header, the Bitstream_Write1 gets correctly renamed to Bitstream_Write11 to avoid duplicate definitions but not its c++ namespace counterpart Bitstream.Write1 that stays this way. The issue indeed doesn't happen without enable_cxx_namespaces() |
A reduced test-case would be: class BitStream {
public:
void Write(const char *inputByteArray, unsigned int numberOfBytes);
void Write(BitStream *bitStream, unsigned numberOfBits);
void Write1();
}; This happens with or without the enable_cxx_namespaces, fwiw. It should probably be fixed here: rust-bindgen/src/codegen/mod.rs Line 2446 in 4d18f76
That code doesn't deal with the method name with multiple uses colliding with the existing one. |
Even though this change does name deduplication in a slower way, it avoids name collisions without any breaking changes in the test suite. Fixes rust-lang#2202
Even though this change does name deduplication in a slower way, it avoids name collisions without any breaking changes in the test suite. Fixes #2202
Input C/C++ Header
I don't quite understand the header I'm using so I'm not able to make a simple example but I'm using RakNet https://github.com/facebookarchive/RakNet.
The header with these functions is BitStream.h
Bindgen Invocation
Actual Results
Expected Results
I would expect the second Write1 to be Write11 and not cause issues.
The text was updated successfully, but these errors were encountered: