Skip to content

Commit f5d4eeb

Browse files
author
Michael Carroll
committed
Change #if to #ifdef.
Needed because you can't use preprocessor on undefined variables in MISRA.
1 parent ff024ee commit f5d4eeb

48 files changed

Lines changed: 95 additions & 95 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

rcl/include/rcl/allocator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#ifndef RCL__ALLOCATOR_H_
1616
#define RCL__ALLOCATOR_H_
1717

18-
#if __cplusplus
18+
#ifdef __cplusplus
1919
extern "C"
2020
{
2121
#endif
@@ -34,7 +34,7 @@ typedef rcutils_allocator_t rcl_allocator_t;
3434
#define RCL_CHECK_ALLOCATOR_WITH_MSG(allocator, msg, fail_statement) \
3535
RCUTILS_CHECK_ALLOCATOR_WITH_MSG(allocator, msg, fail_statement)
3636

37-
#if __cplusplus
37+
#ifdef __cplusplus
3838
}
3939
#endif
4040

rcl/include/rcl/arguments.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "rcl/types.h"
2121
#include "rcl/visibility_control.h"
2222

23-
#if __cplusplus
23+
#ifdef __cplusplus
2424
extern "C"
2525
{
2626
#endif
@@ -220,7 +220,7 @@ RCL_WARN_UNUSED
220220
rcl_arguments_t *
221221
rcl_get_global_arguments();
222222

223-
#if __cplusplus
223+
#ifdef __cplusplus
224224
}
225225
#endif
226226

rcl/include/rcl/client.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#ifndef RCL__CLIENT_H_
1616
#define RCL__CLIENT_H_
1717

18-
#if __cplusplus
18+
#ifdef __cplusplus
1919
extern "C"
2020
{
2121
#endif
@@ -398,7 +398,7 @@ RCL_PUBLIC
398398
bool
399399
rcl_client_is_valid(const rcl_client_t * client, rcl_allocator_t * error_msg_allocator);
400400

401-
#if __cplusplus
401+
#ifdef __cplusplus
402402
}
403403
#endif
404404

rcl/include/rcl/expand_topic_name.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#ifndef RCL__EXPAND_TOPIC_NAME_H_
1616
#define RCL__EXPAND_TOPIC_NAME_H_
1717

18-
#if __cplusplus
18+
#ifdef __cplusplus
1919
extern "C"
2020
{
2121
#endif
@@ -137,7 +137,7 @@ RCL_WARN_UNUSED
137137
rcl_ret_t
138138
rcl_get_default_topic_name_substitutions(rcutils_string_map_t * string_map);
139139

140-
#if __cplusplus
140+
#ifdef __cplusplus
141141
}
142142
#endif
143143

rcl/include/rcl/graph.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#ifndef RCL__GRAPH_H_
1616
#define RCL__GRAPH_H_
1717

18-
#if __cplusplus
18+
#ifdef __cplusplus
1919
extern "C"
2020
{
2121
#endif
@@ -349,7 +349,7 @@ rcl_service_server_is_available(
349349
const rcl_client_t * client,
350350
bool * is_available);
351351

352-
#if __cplusplus
352+
#ifdef __cplusplus
353353
}
354354
#endif
355355

rcl/include/rcl/guard_condition.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#ifndef RCL__GUARD_CONDITION_H_
1616
#define RCL__GUARD_CONDITION_H_
1717

18-
#if __cplusplus
18+
#ifdef __cplusplus
1919
extern "C"
2020
{
2121
#endif
@@ -245,7 +245,7 @@ RCL_WARN_UNUSED
245245
rmw_guard_condition_t *
246246
rcl_guard_condition_get_rmw_handle(const rcl_guard_condition_t * guard_condition);
247247

248-
#if __cplusplus
248+
#ifdef __cplusplus
249249
}
250250
#endif
251251

rcl/include/rcl/macros.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#ifndef RCL__MACROS_H_
1616
#define RCL__MACROS_H_
1717

18-
#if __cplusplus
18+
#ifdef __cplusplus
1919
extern "C"
2020
{
2121
#endif
@@ -27,7 +27,7 @@ extern "C"
2727
# define RCL_WARN_UNUSED _Check_return_
2828
#endif
2929

30-
#if __cplusplus
30+
#ifdef __cplusplus
3131
}
3232
#endif
3333

rcl/include/rcl/node.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#ifndef RCL__NODE_H_
1616
#define RCL__NODE_H_
1717

18-
#if __cplusplus
18+
#ifdef __cplusplus
1919
extern "C"
2020
{
2121
#endif
@@ -486,7 +486,7 @@ RCL_WARN_UNUSED
486486
const char *
487487
rcl_node_get_logger_name(const rcl_node_t * node);
488488

489-
#if __cplusplus
489+
#ifdef __cplusplus
490490
}
491491
#endif
492492

rcl/include/rcl/publisher.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#ifndef RCL__PUBLISHER_H_
1616
#define RCL__PUBLISHER_H_
1717

18-
#if __cplusplus
18+
#ifdef __cplusplus
1919
extern "C"
2020
{
2121
#endif
@@ -363,7 +363,7 @@ rcl_publisher_is_valid(
363363
const rcl_publisher_t * publisher,
364364
rcl_allocator_t * error_msg_allocator);
365365

366-
#if __cplusplus
366+
#ifdef __cplusplus
367367
}
368368
#endif
369369

rcl/include/rcl/rcl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
#ifndef RCL__RCL_H_
6969
#define RCL__RCL_H_
7070

71-
#if __cplusplus
71+
#ifdef __cplusplus
7272
extern "C"
7373
{
7474
#endif
@@ -193,7 +193,7 @@ RCL_WARN_UNUSED
193193
bool
194194
rcl_ok(void);
195195

196-
#if __cplusplus
196+
#ifdef __cplusplus
197197
}
198198
#endif
199199

0 commit comments

Comments
 (0)