-
Notifications
You must be signed in to change notification settings - Fork 741
Extend generated_name_override
callback to variables
#2351
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
Conversation
@skmcgrail thanks for your contribution! I think it might be desirable to add more arguments to |
Yeah, while we're changing the API, let's do as @pvdrz suggests to make sure that we can extend it easily in the future. Thanks! |
Great idea! |
Context
Modifying (typically "prefixing") library symbols is needed to avoid conflicts for applications linking to multiple version of the same library, or when linking to several similar-but-different libraries. For example due to their histories, OpenSSL, BoringSSL and AWS-LC share many symbols in common. To avoid problems for downstream applications that depend on more than one of these libraries, symbol prefixing is needed.
Problem
The recent addition of
ParseCallbacks::generated_name_override
allows for function names that were modified/prefixed during their build, to have the modifications undone so that the generated bindings expose the original/intended name of the function. This is working as intended. However, the problem is that this callback is currently limited to modifying only function names, whereas other symbols (i.e., "extern" variables) may likewise need their names modified/prefixed to avoid link conflicts.Change
ParseCallbacks::generated_name_override
to accept a second parameter indicating the kind of item the name applies to (currently, eitherFunction
orVar
).CallbackItemKind
enum was added to serve as the type for this second parameter.