Skip to content

Commit

Permalink
Fix how header template works to prevent double-inclusion
Browse files Browse the repository at this point in the history
Bug introduced in #116

Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai>
  • Loading branch information
mjcarroll committed Apr 9, 2024
1 parent 5fdc817 commit 95bbda0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,25 @@ include_parts = [package_name] + list(interface_path.parents[0].parts) + [
include_base = '/'.join(include_parts)

header_files = [
'cstddef',
'rosidl_runtime_c/message_type_support_struct.h',
'rosidl_typesupport_interface/macros.h',
package_name + '/msg/rosidl_typesupport_fastrtps_cpp__visibility_control.h',
include_base + '__struct.hpp',
]
}@
#include <cstddef>
@[for header_file in header_files]@
@[ if header_file in include_directives]@
// already included above
// @
@[ else]@
@{include_directives.add(header_file)}@
@[ end if]@
@[ if '/' not in header_file]@
#include <@(header_file)>
@[ else]@
#include "@(header_file)"
@[ end if]@
@[end for]@

#ifndef _WIN32
Expand Down

0 comments on commit 95bbda0

Please sign in to comment.