Skip to content

Commit 431d6f9

Browse files
mjcarrollahcorde
andauthored
Fix how header template works to prevent double-inclusion (#117)
Signed-off-by: Michael Carroll <[email protected]> Signed-off-by: Alejandro Hernández Cordero <[email protected]> Co-authored-by: Alejandro Hernández Cordero <[email protected]>
1 parent 5fdc817 commit 431d6f9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

rosidl_typesupport_fastrtps_cpp/include/rosidl_typesupport_fastrtps_cpp/message_type_support.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#include <cstddef>
1919

20-
#include <fastcdr/Cdr.h>
20+
#include "fastcdr/Cdr.h"
2121

2222
#include "rosidl_runtime_c/message_type_support_struct.h"
2323

rosidl_typesupport_fastrtps_cpp/resource/msg__rosidl_typesupport_fastrtps_cpp.hpp.em

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,25 @@ include_parts = [package_name] + list(interface_path.parents[0].parts) + [
77
include_base = '/'.join(include_parts)
88

99
header_files = [
10+
'cstddef',
1011
'rosidl_runtime_c/message_type_support_struct.h',
1112
'rosidl_typesupport_interface/macros.h',
1213
package_name + '/msg/rosidl_typesupport_fastrtps_cpp__visibility_control.h',
1314
include_base + '__struct.hpp',
1415
]
1516
}@
16-
#include <cstddef>
1717
@[for header_file in header_files]@
1818
@[ if header_file in include_directives]@
1919
// already included above
2020
// @
2121
@[ else]@
2222
@{include_directives.add(header_file)}@
2323
@[ end if]@
24+
@[ if '/' not in header_file]@
25+
#include <@(header_file)>
26+
@[ else]@
2427
#include "@(header_file)"
28+
@[ end if]@
2529
@[end for]@
2630

2731
#ifndef _WIN32

0 commit comments

Comments
 (0)