-
Notifications
You must be signed in to change notification settings - Fork 315
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
alternative way to handle visibility macros #149
alternative way to handle visibility macros #149
Conversation
This is (completely?) off-topic, I'm not an expert on this and I understand the need, but from reading things like gcc/wiki/Visibility I'm wondering if we're not stepping through some hellish portal to the special ring in ROS2 programming/framework support hell with this. Are regular users (ie: not contributing users) expected to deal with this as well? |
@gavanderhoorn it's only important if you want your code to work on Windows. Also, it may be possible to hide everything about a component behind the class loader interface, in which case we may be able to get away with no symbol visibility management at all even on Windows, but that needs some more experimentation to see if that's true. More than likely most people will be able to safely ignore these things, but speaking for myself, I figured the example should be as complete and correct as possible. |
Looks awesome 🎉 🌮 but deferred until Beta 2. 😞 |
Need feedback now that the beta release has occurred. |
The approach looks interesting and I would be in favor of putting this header into the new package |
agreed, |
I was originally proposing this for "simple" packages, because while this proposal has a low fixed cost (dependency on package with this general purpose header versus having your own header in your package) it does have a higher variable cost (more boilerplate LOC per file that uses visibility control). So for a package like It might be a good solution still for the type support code because that's means fewer files we have to generate per message package. I'm fine with putting it in the I don't have time to do this right now. Maybe we should put this back in ready or close this and open an issue and put it in ready? |
👍 for closing this and open an issue to add this to |
@codebot please don't merge this as-is, because it has a header in it that would be placed in
rcl
instead of this package if others agree this is an ok strategy for simple packages.I'll paste the docstring from that header here as way of explanation:
The advantage of this approach is that it avoids having to have a header that is dedicated to visibility in this package. It still results in some boilerplate that is easy to mess up, but the other approach seems equally fragile to me, since they might forget to pass the
-D..._BUILDING_DLL=1
to the compiler or something like that. The state of the "public" macro is baked into the code here.