diff --git a/ublox_msgs/CMakeLists.txt b/ublox_msgs/CMakeLists.txt index 4e3db305..54940932 100644 --- a/ublox_msgs/CMakeLists.txt +++ b/ublox_msgs/CMakeLists.txt @@ -10,6 +10,10 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic) endif() +if(WIN32) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + find_package(ament_cmake_ros REQUIRED) find_package(rosidl_default_generators REQUIRED) find_package(sensor_msgs REQUIRED) diff --git a/ublox_msgs/include/ublox_msgs/ublox_msgs.hpp b/ublox_msgs/include/ublox_msgs/ublox_msgs.hpp index b1ac7155..13ef3cb8 100644 --- a/ublox_msgs/include/ublox_msgs/ublox_msgs.hpp +++ b/ublox_msgs/include/ublox_msgs/ublox_msgs.hpp @@ -191,7 +191,16 @@ namespace Message { } // namespace RXM namespace INF { +#if defined(_WIN32) && defined(ERROR) +#pragma push_macro("ERROR") +#undef ERROR +#define UBLOX_MSGS_RESTORE_ERROR_MACRO +#endif static const uint8_t ERROR = 0x00; +#if defined(UBLOX_MSGS_RESTORE_ERROR_MACRO) +#pragma pop_macro("ERROR") +#undef UBLOX_MSGS_RESTORE_ERROR_MACRO +#endif static const uint8_t WARNING = 0x01; static const uint8_t NOTICE = 0x02; static const uint8_t TEST = 0x03;