[Discourse.ros.org] [Next Generation ROS] if(WIN32) guard is missed for many projects in ROS2

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Discourse.ros.org] [Next Generation ROS] if(WIN32) guard is missed for many projects in ROS2

Dirk Thomas via ros-users


Per my understanding XXX_BUILDING_DLL macro only should be enabled when building on Windows, right?
If that's true, I don't understand why "if(WIND32)" guard is missed in so many projects, such as ament it self.
Could anybody explain it?

Thanks





---
[Visit Topic](https://discourse.ros.org/t/if-win32-guard-is-missed-for-many-projects-in-ros2/2281/1) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Discourse.ros.org] [Next Generation ROS] if(WIN32) guard is missed for many projects in ROS2

Dirk Thomas via ros-users


Per my understanding the macros XXX_BUILDING_DLL are processed (replacing `XXX_PUBLIC` by `XXX_EXPORT` instead of `XXX_IMPORT`) only if WIN32 is defined. The macros controlling this behavior can be found in the [visibility control file](https://github.com/ament/ament_index/blob/c41459dfe07e10a4449ca322efc87e17ef59cd85/ament_index_cpp/include/ament_index_cpp/visibility_control.h#L26) of each package, here `ament_index_cpp` for example).
So If I understand correctly adding an `if(WIN32)` would be redundant.





---
[Visit Topic](https://discourse.ros.org/t/if-win32-guard-is-missed-for-many-projects-in-ros2/2281/2) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Discourse.ros.org] [Next Generation ROS] if(WIN32) guard is missed for many projects in ROS2

Dirk Thomas via ros-users
In reply to this post by Dirk Thomas via ros-users


Actually it also affects the `_LOCAL` visibility macro even on posix machines. So it should always be set, imo. Perhaps it could be given a more generic name that doesn't contain dll. I think we may have even done this in a couple of packages.





---
[Visit Topic](https://discourse.ros.org/t/if-win32-guard-is-missed-for-many-projects-in-ros2/2281/3) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Discourse.ros.org] [Next Generation ROS] if(WIN32) guard is missed for many projects in ROS2

Dirk Thomas via ros-users
In reply to this post by Dirk Thomas via ros-users


[quote="wjwwood, post:3, topic:2281, full:true"]
Actually it also affects the `_LOCAL` visibility macro even on posix machines. So it should always be set, imo. Perhaps it could be given a more generic name that doesn't contain dll. I think we may have even done this in a couple of packages.
[/quote]

Then it's better to make a model in ROS2's core pojects, so that when people are porting other projects could always have right samples.





---
[Visit Topic](https://discourse.ros.org/t/if-win32-guard-is-missed-for-many-projects-in-ros2/2281/4) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Discourse.ros.org] [Next Generation ROS] if(WIN32) guard is missed for many projects in ROS2

Dirk Thomas via ros-users
In reply to this post by Dirk Thomas via ros-users


Yeah, it would be good to have that. I probably won't spend time updating them right now as we have lots of other important things to do as well, but we would probably take pull requests along those lines (renaming the definition to be more accurate).





---
[Visit Topic](https://discourse.ros.org/t/if-win32-guard-is-missed-for-many-projects-in-ros2/2281/5) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Discourse.ros.org] [Next Generation ROS] if(WIN32) guard is missed for many projects in ROS2

Dirk Thomas via ros-users
In reply to this post by Dirk Thomas via ros-users


Gotcha, thanks for your explanation.





---
[Visit Topic](https://discourse.ros.org/t/if-win32-guard-is-missed-for-many-projects-in-ros2/2281/6) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Loading...