Skip to content

Commit

Permalink
patch for autoware utils
Browse files Browse the repository at this point in the history
Signed-off-by: wep21 <[email protected]>
  • Loading branch information
wep21 committed Jan 16, 2025
1 parent fcc6ad9 commit 0df9435
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions patch/ros-humble-autoware-utils.win.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 21eb4ad..170a838 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,10 @@
cmake_minimum_required(VERSION 3.14)
project(autoware_utils)

+if(WIN32 AND MSVC)
+ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
+endif()
+
find_package(autoware_cmake REQUIRED)
autoware_package()

diff --git a/include/autoware_utils/ros/uuid_helper.hpp b/include/autoware_utils/ros/uuid_helper.hpp
index 8e27b4c..bbb817f 100644
--- a/include/autoware_utils/ros/uuid_helper.hpp
+++ b/include/autoware_utils/ros/uuid_helper.hpp
@@ -23,6 +23,10 @@
#include <random>
#include <string>

+#if defined(_MSC_VER) && (_MSC_VER < 1600)
+typedef unsigned __int8 uint8_t;
+#endif
+
namespace autoware_utils
{
inline unique_identifier_msgs::msg::UUID generate_uuid()
@@ -30,7 +34,11 @@ inline unique_identifier_msgs::msg::UUID generate_uuid()
// Generate random number
unique_identifier_msgs::msg::UUID uuid;
std::mt19937 gen(std::random_device{}());
+#if defined(_MSC_VER)
+ std::independent_bits_engine<std::mt19937, 8, unsigned short> bit_eng(gen);
+#else
std::independent_bits_engine<std::mt19937, 8, uint8_t> bit_eng(gen);
+#endif
std::generate(uuid.uuid.begin(), uuid.uuid.end(), bit_eng);

return uuid;

0 comments on commit 0df9435

Please sign in to comment.