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 52965e5
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions patch/ros-humble-autoware-utils.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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 52965e5

Please sign in to comment.