Skip to content

Fix ublox_msgs Windows portability#282

Open
Tobias-Fischer wants to merge 1 commit into
KumarRobotics:ros2from
Tobias-Fischer:codex/robostack-ublox-msgs-windows-export
Open

Fix ublox_msgs Windows portability#282
Tobias-Fischer wants to merge 1 commit into
KumarRobotics:ros2from
Tobias-Fischer:codex/robostack-ublox-msgs-windows-export

Conversation

@Tobias-Fischer

Copy link
Copy Markdown

This is part of an effort to contribute RoboStack downstream patches back upstream.

Origin: patch/ros-rolling-ublox-msgs.win.patch, authored by Daisuke Nishimatsu.

This keeps the ROS 2 ublox_msgs headers and support library friendlier to Windows builds. The Windows SDK can define ERROR as a macro, which collides with the existing ublox_msgs::Message::INF::ERROR constant in the public header. The guard keeps the existing API while avoiding that macro collision.

The support library is also built with CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS on Windows so downstream consumers can link the generated DLL without hand-maintained export annotations.

This upstreams the Windows-focused part of the RoboStack ublox_msgs build fix.

On Windows, the system ERROR macro can collide with the ublox_msgs::Message::INF::ERROR constant. Guarding the macro locally lets the public header keep its existing API. Enabling CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS exports the ublox_msgs support library symbols for downstream consumers.

Origin: patch/ros-rolling-ublox-msgs.win.patch, authored by Daisuke Nishimatsu.
Signed-off-by: Tobias Fischer <info@tobiasfischer.info>
@Tobias-Fischer

Copy link
Copy Markdown
Author

FYI @wep21 and @traversaro: I opened this while upstreaming RoboStack patches tracked in RoboStack/robostack.github.io#16. This one comes from patch/ros-rolling-ublox-msgs.win.patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant