From c3e843ea7e698879feccdfad49ac7e683d7a145b Mon Sep 17 00:00:00 2001 From: pablogs9 Date: Fri, 15 Sep 2023 06:15:15 +0000 Subject: [PATCH] micro-ROS iron Library auto-update 15-09-2023 06:08 --- built_packages | 2 +- .../rosidl_dynamic_typesupport/uchar.h | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/built_packages b/built_packages index 7637096a..8cf46cc1 100755 --- a/built_packages +++ b/built_packages @@ -31,7 +31,7 @@ https://github.com/ros2/rosidl.git 995917e9ce14d17821c04bf28d5a092111537842 https://github.com/ros2/rosidl_core.git 83df4c6574f90a8479d0b0211a463a7806ad6179 https://github.com/ros2/rosidl_dds.git f074b295c316e9bbb9845344cc6ab882339e9305 https://github.com/ros2/rosidl_defaults.git 34a204f3ce0528c6ec3bb89d33404422eb879995 -https://github.com/ros2/rosidl_dynamic_typesupport 9e9264c5718489dea75337657473a183ed5ec19c +https://github.com/ros2/rosidl_dynamic_typesupport 58e39fdc961273abf4587ac89b632063e9b55ca5 https://github.com/ros2/test_interface_files.git 3abbbf68d939cac86e53992b68ee93f9a37fff41 https://github.com/ros2/unique_identifier_msgs.git 1ced881f07e5d5744d01867b1caedbc13c856195 https://github.com/yaml/libyaml.git 2c891fc7a770e8ba2fec34fc6b545c672beb37e6 diff --git a/libmicroros/include/rosidl_dynamic_typesupport/uchar.h b/libmicroros/include/rosidl_dynamic_typesupport/uchar.h index 928ef358..5979f90e 100755 --- a/libmicroros/include/rosidl_dynamic_typesupport/uchar.h +++ b/libmicroros/include/rosidl_dynamic_typesupport/uchar.h @@ -22,12 +22,25 @@ extern "C" { #if defined(__cplusplus) && __cplusplus >= 201103L // Nothing to do here, C++11 and beyond have char16_t as a keyword: // https://en.cppreference.com/w/cpp/keyword/char16_t -#elif defined(__has_include) && __has_include() +#else +// According to https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005finclude.html, +// short-circuit style use of __has_include is not supported, so split the conditional +# if defined(__has_include) +# if __has_include() // If the compiler has __has_include, and uchar.h exists, include that as it will have char16_t // as a typedef. -# include -#else +# include +# else // Otherwise assume that char16_t isn't defined anywhere, and define it ourselves as uint_least16_t. +# define __ROSIDL_DYNAMIC_TYPESUPPORT__UCHAR_H__NEEDS_CHAR16_T_DECL +# endif +# else +# define __ROSIDL_DYNAMIC_TYPESUPPORT__UCHAR_H__NEEDS_CHAR16_T_DECL +# endif +#endif + +#if defined(__ROSIDL_DYNAMIC_TYPESUPPORT__UCHAR_H__NEEDS_CHAR16_T_DECL) +# undef __ROSIDL_DYNAMIC_TYPESUPPORT__UCHAR_H__NEEDS_CHAR16_T_DECL # include typedef uint_least16_t char16_t; #endif