Skip to content

Commit e258e78

Browse files
clalancettejacobperron
authored andcommitted
Fix a cpplint allocator regression. (#590)
We can't unconditionally include rcutils/allocator.h in the msg__functions.c.em, because that file is used multiple times when generating services. That causes cpplint to complain about a duplicate include. Instead put the include in idl__functions.c.em, and mark it as already included so we won't try to include it again. Signed-off-by: Chris Lalancette <[email protected]> Signed-off-by: Shane Loretz <[email protected]>
1 parent 073dfba commit e258e78

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

rosidl_generator_c/resource/idl__functions.c.em

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,16 @@ include_parts = [package_name] + list(interface_path.parents[0].parts) + [
1616
'detail', convert_camel_case_to_lower_case_underscore(interface_path.stem)]
1717
include_base = '/'.join(include_parts)
1818

19-
include_directives = {include_base + '__functions.h'}
19+
include_directives = {include_base + '__functions.h', 'rcutils/allocator.h'}
2020
}@
2121
#include "@(include_base)__functions.h"
2222

2323
#include <assert.h>
2424
#include <stdbool.h>
2525
#include <stdlib.h>
2626
#include <string.h>
27+
28+
#include "rcutils/allocator.h"
2729
@
2830
@#######################################################################
2931
@# Handle message

rosidl_generator_c/resource/msg__functions.c.em

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ for member in message.structure.members:
5252
@#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
5353
@
5454
@#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
55-
#include <rcutils/allocator.h>
56-
5755
@[if includes]@
5856

5957
// Include directives for member types

0 commit comments

Comments
 (0)