From d4264b70387e91b8f46a40ff307881f28ff07c04 Mon Sep 17 00:00:00 2001 From: Brian Gerkey Date: Fri, 15 Apr 2016 15:46:31 -0700 Subject: [PATCH] #undef ERROR on windows to avoid conflict with constant by the same name --- rosidl_generator_cpp/resource/msg__struct.hpp.template | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rosidl_generator_cpp/resource/msg__struct.hpp.template b/rosidl_generator_cpp/resource/msg__struct.hpp.template index 3869fa803..5e0df5546 100644 --- a/rosidl_generator_cpp/resource/msg__struct.hpp.template +++ b/rosidl_generator_cpp/resource/msg__struct.hpp.template @@ -22,6 +22,12 @@ header_guard_variable = '__'.join([x.upper() for x in header_guard_parts]) + '_' #ifndef @(header_guard_variable) #define @(header_guard_variable) +// Protect against ERROR being predefined on Windows, in case somebody defines a +// constant by that name. +#if defined(_WIN32 ) && defined(ERROR) + #undef ERROR +#endif + @{ from rosidl_generator_cpp import escape_string from rosidl_generator_cpp import msg_type_to_cpp