From cb60ab705d713db884004b550b3fdecb60686984 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Mon, 23 Apr 2018 10:20:30 -0500 Subject: [PATCH] Change #if to #ifdef. Needed because you can't use preprocessor on undefined variables in MISRA. --- rcl/include/rcl/allocator.h | 4 ++-- rcl/include/rcl/arguments.h | 4 ++-- rcl/include/rcl/client.h | 4 ++-- rcl/include/rcl/expand_topic_name.h | 4 ++-- rcl/include/rcl/graph.h | 4 ++-- rcl/include/rcl/guard_condition.h | 4 ++-- rcl/include/rcl/macros.h | 4 ++-- rcl/include/rcl/node.h | 4 ++-- rcl/include/rcl/publisher.h | 4 ++-- rcl/include/rcl/rcl.h | 4 ++-- rcl/include/rcl/remap.h | 4 ++-- rcl/include/rcl/service.h | 4 ++-- rcl/include/rcl/subscription.h | 4 ++-- rcl/include/rcl/time.h | 4 ++-- rcl/include/rcl/timer.h | 4 ++-- rcl/include/rcl/validate_topic_name.h | 4 ++-- rcl/include/rcl/visibility_control.h | 4 ++-- rcl/include/rcl/wait.h | 4 ++-- rcl/src/rcl/arguments.c | 4 ++-- rcl/src/rcl/arguments_impl.h | 4 ++-- rcl/src/rcl/client.c | 4 ++-- rcl/src/rcl/common.c | 4 ++-- rcl/src/rcl/common.h | 4 ++-- rcl/src/rcl/expand_topic_name.c | 4 ++-- rcl/src/rcl/graph.c | 4 ++-- rcl/src/rcl/guard_condition.c | 4 ++-- rcl/src/rcl/node.c | 4 ++-- rcl/src/rcl/publisher.c | 4 ++-- rcl/src/rcl/rcl.c | 4 ++-- rcl/src/rcl/remap.c | 4 ++-- rcl/src/rcl/remap_impl.h | 4 ++-- rcl/src/rcl/rmw_implementation_identifier_check.c | 4 ++-- rcl/src/rcl/service.c | 4 ++-- rcl/src/rcl/stdatomic_helper/gcc/stdatomic.h | 2 +- rcl/src/rcl/subscription.c | 4 ++-- rcl/src/rcl/timer.c | 4 ++-- rcl/src/rcl/validate_topic_name.c | 4 ++-- rcl/src/rcl/wait.c | 4 ++-- rcl_lifecycle/include/rcl_lifecycle/data_types.h | 4 ++-- rcl_lifecycle/include/rcl_lifecycle/rcl_lifecycle.h | 4 ++-- rcl_lifecycle/include/rcl_lifecycle/transition_map.h | 4 ++-- rcl_lifecycle/src/com_interface.c | 4 ++-- rcl_lifecycle/src/com_interface.h | 4 ++-- rcl_lifecycle/src/default_state_machine.c | 4 ++-- rcl_lifecycle/src/default_state_machine.h | 4 ++-- rcl_lifecycle/src/rcl_lifecycle.c | 4 ++-- rcl_lifecycle/src/states.h | 4 ++-- rcl_lifecycle/src/transition_map.c | 4 ++-- 48 files changed, 95 insertions(+), 95 deletions(-) diff --git a/rcl/include/rcl/allocator.h b/rcl/include/rcl/allocator.h index 1a4fd58cb5..1b3906f1e6 100644 --- a/rcl/include/rcl/allocator.h +++ b/rcl/include/rcl/allocator.h @@ -15,7 +15,7 @@ #ifndef RCL__ALLOCATOR_H_ #define RCL__ALLOCATOR_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -34,7 +34,7 @@ typedef rcutils_allocator_t rcl_allocator_t; #define RCL_CHECK_ALLOCATOR_WITH_MSG(allocator, msg, fail_statement) \ RCUTILS_CHECK_ALLOCATOR_WITH_MSG(allocator, msg, fail_statement) -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/include/rcl/arguments.h b/rcl/include/rcl/arguments.h index 96c239b7b6..a4a63d463b 100644 --- a/rcl/include/rcl/arguments.h +++ b/rcl/include/rcl/arguments.h @@ -20,7 +20,7 @@ #include "rcl/types.h" #include "rcl/visibility_control.h" -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -220,7 +220,7 @@ RCL_WARN_UNUSED rcl_arguments_t * rcl_get_global_arguments(); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/include/rcl/client.h b/rcl/include/rcl/client.h index 7f7e1364bb..56dc09a90b 100644 --- a/rcl/include/rcl/client.h +++ b/rcl/include/rcl/client.h @@ -15,7 +15,7 @@ #ifndef RCL__CLIENT_H_ #define RCL__CLIENT_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -398,7 +398,7 @@ RCL_PUBLIC bool rcl_client_is_valid(const rcl_client_t * client, rcl_allocator_t * error_msg_allocator); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/include/rcl/expand_topic_name.h b/rcl/include/rcl/expand_topic_name.h index 48f6edb20a..bfcc288de0 100644 --- a/rcl/include/rcl/expand_topic_name.h +++ b/rcl/include/rcl/expand_topic_name.h @@ -15,7 +15,7 @@ #ifndef RCL__EXPAND_TOPIC_NAME_H_ #define RCL__EXPAND_TOPIC_NAME_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -137,7 +137,7 @@ RCL_WARN_UNUSED rcl_ret_t rcl_get_default_topic_name_substitutions(rcutils_string_map_t * string_map); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/include/rcl/graph.h b/rcl/include/rcl/graph.h index ae30a9dbc3..4b7156585a 100644 --- a/rcl/include/rcl/graph.h +++ b/rcl/include/rcl/graph.h @@ -15,7 +15,7 @@ #ifndef RCL__GRAPH_H_ #define RCL__GRAPH_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -349,7 +349,7 @@ rcl_service_server_is_available( const rcl_client_t * client, bool * is_available); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/include/rcl/guard_condition.h b/rcl/include/rcl/guard_condition.h index 233fc694f1..8c4781ce4a 100644 --- a/rcl/include/rcl/guard_condition.h +++ b/rcl/include/rcl/guard_condition.h @@ -15,7 +15,7 @@ #ifndef RCL__GUARD_CONDITION_H_ #define RCL__GUARD_CONDITION_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -245,7 +245,7 @@ RCL_WARN_UNUSED rmw_guard_condition_t * rcl_guard_condition_get_rmw_handle(const rcl_guard_condition_t * guard_condition); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/include/rcl/macros.h b/rcl/include/rcl/macros.h index 192110a637..94ff59d49d 100644 --- a/rcl/include/rcl/macros.h +++ b/rcl/include/rcl/macros.h @@ -15,7 +15,7 @@ #ifndef RCL__MACROS_H_ #define RCL__MACROS_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -27,7 +27,7 @@ extern "C" # define RCL_WARN_UNUSED _Check_return_ #endif -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/include/rcl/node.h b/rcl/include/rcl/node.h index 7fa25b65b4..212a26fd5e 100644 --- a/rcl/include/rcl/node.h +++ b/rcl/include/rcl/node.h @@ -15,7 +15,7 @@ #ifndef RCL__NODE_H_ #define RCL__NODE_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -486,7 +486,7 @@ RCL_WARN_UNUSED const char * rcl_node_get_logger_name(const rcl_node_t * node); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/include/rcl/publisher.h b/rcl/include/rcl/publisher.h index 30af0302e9..44b9c50865 100644 --- a/rcl/include/rcl/publisher.h +++ b/rcl/include/rcl/publisher.h @@ -15,7 +15,7 @@ #ifndef RCL__PUBLISHER_H_ #define RCL__PUBLISHER_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -363,7 +363,7 @@ rcl_publisher_is_valid( const rcl_publisher_t * publisher, rcl_allocator_t * error_msg_allocator); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/include/rcl/rcl.h b/rcl/include/rcl/rcl.h index 97874037a2..66ba0de6e2 100644 --- a/rcl/include/rcl/rcl.h +++ b/rcl/include/rcl/rcl.h @@ -68,7 +68,7 @@ #ifndef RCL__RCL_H_ #define RCL__RCL_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -193,7 +193,7 @@ RCL_WARN_UNUSED bool rcl_ok(void); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/include/rcl/remap.h b/rcl/include/rcl/remap.h index a8b68f6919..82f639da18 100644 --- a/rcl/include/rcl/remap.h +++ b/rcl/include/rcl/remap.h @@ -21,7 +21,7 @@ #include "rcl/types.h" #include "rcl/visibility_control.h" -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -232,7 +232,7 @@ rcl_remap_node_namespace( rcl_allocator_t allocator, char ** output_namespace); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/include/rcl/service.h b/rcl/include/rcl/service.h index 20e156f149..4f36bd494d 100644 --- a/rcl/include/rcl/service.h +++ b/rcl/include/rcl/service.h @@ -15,7 +15,7 @@ #ifndef RCL__SERVICE_H_ #define RCL__SERVICE_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -410,7 +410,7 @@ RCL_PUBLIC bool rcl_service_is_valid(const rcl_service_t * service, rcl_allocator_t * error_msg_allocator); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/include/rcl/subscription.h b/rcl/include/rcl/subscription.h index 08c932d178..507245ba2e 100644 --- a/rcl/include/rcl/subscription.h +++ b/rcl/include/rcl/subscription.h @@ -15,7 +15,7 @@ #ifndef RCL__SUBSCRIPTION_H_ #define RCL__SUBSCRIPTION_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -367,7 +367,7 @@ rcl_subscription_is_valid( const rcl_subscription_t * subscription, rcl_allocator_t * error_msg_allocator); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/include/rcl/time.h b/rcl/include/rcl/time.h index e78f4a1e6d..359bc139ad 100644 --- a/rcl/include/rcl/time.h +++ b/rcl/include/rcl/time.h @@ -15,7 +15,7 @@ #ifndef RCL__TIME_H_ #define RCL__TIME_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -358,7 +358,7 @@ rcl_ret_t rcl_set_ros_time_override( rcl_clock_t * clock, rcl_time_point_value_t time_value); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/include/rcl/timer.h b/rcl/include/rcl/timer.h index 424bb1f1d1..069c1dac64 100644 --- a/rcl/include/rcl/timer.h +++ b/rcl/include/rcl/timer.h @@ -15,7 +15,7 @@ #ifndef RCL__TIMER_H_ #define RCL__TIMER_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -526,7 +526,7 @@ rcl_timer_reset(rcl_timer_t * timer); const rcl_allocator_t * rcl_timer_get_allocator(const rcl_timer_t * timer); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/include/rcl/validate_topic_name.h b/rcl/include/rcl/validate_topic_name.h index 8f23392720..1ebe90adae 100644 --- a/rcl/include/rcl/validate_topic_name.h +++ b/rcl/include/rcl/validate_topic_name.h @@ -15,7 +15,7 @@ #ifndef RCL__VALIDATE_TOPIC_NAME_H_ #define RCL__VALIDATE_TOPIC_NAME_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -116,7 +116,7 @@ RCL_WARN_UNUSED const char * rcl_topic_name_validation_result_string(int validation_result); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/include/rcl/visibility_control.h b/rcl/include/rcl/visibility_control.h index 85e3b16346..9c8c497355 100644 --- a/rcl/include/rcl/visibility_control.h +++ b/rcl/include/rcl/visibility_control.h @@ -15,7 +15,7 @@ #ifndef RCL__VISIBILITY_CONTROL_H_ #define RCL__VISIBILITY_CONTROL_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -51,7 +51,7 @@ extern "C" #define RCL_PUBLIC_TYPE #endif -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/include/rcl/wait.h b/rcl/include/rcl/wait.h index 0d553b00ed..62900a8f13 100644 --- a/rcl/include/rcl/wait.h +++ b/rcl/include/rcl/wait.h @@ -15,7 +15,7 @@ #ifndef RCL__WAIT_H_ #define RCL__WAIT_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -501,7 +501,7 @@ RCL_WARN_UNUSED rcl_ret_t rcl_wait(rcl_wait_set_t * wait_set, int64_t timeout); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/arguments.c b/rcl/src/rcl/arguments.c index 1e3d8b1e1f..aa7c6ad07d 100644 --- a/rcl/src/rcl/arguments.c +++ b/rcl/src/rcl/arguments.c @@ -26,7 +26,7 @@ #include "rmw/validate_namespace.h" #include "rmw/validate_node_name.h" -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -447,6 +447,6 @@ rcl_get_global_arguments() return &__rcl_global_arguments; } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/arguments_impl.h b/rcl/src/rcl/arguments_impl.h index 5e7e94b032..a689c2c114 100644 --- a/rcl/src/rcl/arguments_impl.h +++ b/rcl/src/rcl/arguments_impl.h @@ -18,7 +18,7 @@ #include "rcl/arguments.h" #include "./remap_impl.h" -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -40,7 +40,7 @@ typedef struct rcl_arguments_impl_t rcl_allocator_t allocator; } rcl_arguments_impl_t; -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/client.c b/rcl/src/rcl/client.c index c695c7bd9a..1f00bd717b 100644 --- a/rcl/src/rcl/client.c +++ b/rcl/src/rcl/client.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -331,6 +331,6 @@ rcl_client_is_valid(const rcl_client_t * client, rcl_allocator_t * error_msg_all client->impl->rmw_handle, "client's rmw handle is invalid", return false, alloc); return true; } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/common.c b/rcl/src/rcl/common.c index 18a72f5079..14c099ecce 100644 --- a/rcl/src/rcl/common.c +++ b/rcl/src/rcl/common.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -68,6 +68,6 @@ rcl_convert_rmw_ret_to_rcl_ret(rmw_ret_t rmw_ret) } } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/common.h b/rcl/src/rcl/common.h index f8c0c89890..d606b3b197 100644 --- a/rcl/src/rcl/common.h +++ b/rcl/src/rcl/common.h @@ -15,7 +15,7 @@ #ifndef RCL__COMMON_H_ #define RCL__COMMON_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -47,7 +47,7 @@ rcl_impl_getenv(const char * env_name, const char ** env_value); rcl_ret_t rcl_convert_rmw_ret_to_rcl_ret(rmw_ret_t rmw_ret); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/expand_topic_name.c b/rcl/src/rcl/expand_topic_name.c index bd59ae0ceb..a2eae883fd 100644 --- a/rcl/src/rcl/expand_topic_name.c +++ b/rcl/src/rcl/expand_topic_name.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -246,6 +246,6 @@ rcl_get_default_topic_name_substitutions(rcutils_string_map_t * string_map) return RCL_RET_OK; } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/graph.c b/rcl/src/rcl/graph.c index ea975b4ce9..4022b5de49 100644 --- a/rcl/src/rcl/graph.c +++ b/rcl/src/rcl/graph.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -180,6 +180,6 @@ rcl_service_server_is_available( return rcl_convert_rmw_ret_to_rcl_ret(rmw_ret); } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/guard_condition.c b/rcl/src/rcl/guard_condition.c index 599ee2060d..41bb27f2fb 100644 --- a/rcl/src/rcl/guard_condition.c +++ b/rcl/src/rcl/guard_condition.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -176,6 +176,6 @@ rcl_guard_condition_get_rmw_handle(const rcl_guard_condition_t * guard_condition return guard_condition->impl->rmw_handle; } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/node.c b/rcl/src/rcl/node.c index 0f0e294dc3..4813bab9cc 100644 --- a/rcl/src/rcl/node.c +++ b/rcl/src/rcl/node.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -538,6 +538,6 @@ rcl_node_get_logger_name(const rcl_node_t * node) return node->impl->logger_name; } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/publisher.c b/rcl/src/rcl/publisher.c index 4b737f91f8..1cbabb8d79 100644 --- a/rcl/src/rcl/publisher.c +++ b/rcl/src/rcl/publisher.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -293,6 +293,6 @@ rcl_publisher_is_valid( return true; } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/rcl.c b/rcl/src/rcl/rcl.c index ca9695d30f..ca4d2fa8fa 100644 --- a/rcl/src/rcl/rcl.c +++ b/rcl/src/rcl/rcl.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -155,6 +155,6 @@ rcl_ok() return rcl_atomic_load_bool(&__rcl_is_initialized); } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/remap.c b/rcl/src/rcl/remap.c index 690d161d6b..a3833ffc4d 100644 --- a/rcl/src/rcl/remap.c +++ b/rcl/src/rcl/remap.c @@ -22,7 +22,7 @@ #include "rcutils/strdup.h" #include "rcutils/types/string_map.h" -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -274,6 +274,6 @@ rcl_remap_node_namespace( allocator, output_namespace); } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/remap_impl.h b/rcl/src/rcl/remap_impl.h index cb073a9361..d02768cb55 100644 --- a/rcl/src/rcl/remap_impl.h +++ b/rcl/src/rcl/remap_impl.h @@ -17,7 +17,7 @@ #include "rcl/types.h" -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -73,7 +73,7 @@ rcl_ret_t rcl_remap_fini( rcl_remap_t * rule); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/rmw_implementation_identifier_check.c b/rcl/src/rcl/rmw_implementation_identifier_check.c index d1f7f12812..af0f0d3825 100644 --- a/rcl/src/rcl/rmw_implementation_identifier_check.c +++ b/rcl/src/rcl/rmw_implementation_identifier_check.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -150,6 +150,6 @@ INITIALIZER(initialize) { } } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/service.c b/rcl/src/rcl/service.c index c2195c68cd..8167f77e6b 100644 --- a/rcl/src/rcl/service.c +++ b/rcl/src/rcl/service.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -338,6 +338,6 @@ rcl_service_is_valid(const rcl_service_t * service, rcl_allocator_t * error_msg_ return true; } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/stdatomic_helper/gcc/stdatomic.h b/rcl/src/rcl/stdatomic_helper/gcc/stdatomic.h index dd0c674c2f..e853dec493 100644 --- a/rcl/src/rcl/stdatomic_helper/gcc/stdatomic.h +++ b/rcl/src/rcl/stdatomic_helper/gcc/stdatomic.h @@ -74,7 +74,7 @@ #ifndef _STDATOMIC_H_ // NOLINT #define _STDATOMIC_H_ -#if __cplusplus +#ifdef __cplusplus // This will suppress warnings about _Bool not being defined. typedef bool _Bool; #endif diff --git a/rcl/src/rcl/subscription.c b/rcl/src/rcl/subscription.c index de83cff468..2a8837bc62 100644 --- a/rcl/src/rcl/subscription.c +++ b/rcl/src/rcl/subscription.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -327,6 +327,6 @@ rcl_subscription_is_valid( return true; } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/timer.c b/rcl/src/rcl/timer.c index e688d0ac2a..8ff6ac230c 100644 --- a/rcl/src/rcl/timer.c +++ b/rcl/src/rcl/timer.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -280,6 +280,6 @@ rcl_timer_get_allocator(const rcl_timer_t * timer) return &timer->impl->allocator; } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/validate_topic_name.c b/rcl/src/rcl/validate_topic_name.c index a17635c778..82f9490e76 100644 --- a/rcl/src/rcl/validate_topic_name.c +++ b/rcl/src/rcl/validate_topic_name.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -231,6 +231,6 @@ rcl_topic_name_validation_result_string(int validation_result) } } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/wait.c b/rcl/src/rcl/wait.c index 8d54cc22be..0ce0f20b32 100644 --- a/rcl/src/rcl/wait.c +++ b/rcl/src/rcl/wait.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -684,6 +684,6 @@ rcl_wait(rcl_wait_set_t * wait_set, int64_t timeout) return RCL_RET_OK; } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl_lifecycle/include/rcl_lifecycle/data_types.h b/rcl_lifecycle/include/rcl_lifecycle/data_types.h index 58438318dd..b8dc1024ff 100644 --- a/rcl_lifecycle/include/rcl_lifecycle/data_types.h +++ b/rcl_lifecycle/include/rcl_lifecycle/data_types.h @@ -19,7 +19,7 @@ #include "rcl_lifecycle/visibility_control.h" -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -82,7 +82,7 @@ typedef struct rcl_lifecycle_state_machine_t rcl_lifecycle_com_interface_t com_interface; } rcl_lifecycle_state_machine_t; -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl_lifecycle/include/rcl_lifecycle/rcl_lifecycle.h b/rcl_lifecycle/include/rcl_lifecycle/rcl_lifecycle.h index e032d506d7..0e95286452 100644 --- a/rcl_lifecycle/include/rcl_lifecycle/rcl_lifecycle.h +++ b/rcl_lifecycle/include/rcl_lifecycle/rcl_lifecycle.h @@ -15,7 +15,7 @@ #ifndef RCL_LIFECYCLE__RCL_LIFECYCLE_H_ #define RCL_LIFECYCLE__RCL_LIFECYCLE_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -135,7 +135,7 @@ RCL_LIFECYCLE_PUBLIC void rcl_print_state_machine(const rcl_lifecycle_state_machine_t * state_machine); -#if __cplusplus +#ifdef __cplusplus } #endif // extern "C" diff --git a/rcl_lifecycle/include/rcl_lifecycle/transition_map.h b/rcl_lifecycle/include/rcl_lifecycle/transition_map.h index c7528c2988..9b2b7823b2 100644 --- a/rcl_lifecycle/include/rcl_lifecycle/transition_map.h +++ b/rcl_lifecycle/include/rcl_lifecycle/transition_map.h @@ -20,7 +20,7 @@ #include "rcl_lifecycle/data_types.h" -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -74,7 +74,7 @@ rcl_lifecycle_get_transitions( rcl_lifecycle_transition_map_t * transition_map, unsigned int state_id); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl_lifecycle/src/com_interface.c b/rcl_lifecycle/src/com_interface.c index f118b4a5a0..11fc42408b 100644 --- a/rcl_lifecycle/src/com_interface.c +++ b/rcl_lifecycle/src/com_interface.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -323,6 +323,6 @@ rcl_lifecycle_com_interface_publish_notification( return rcl_publish(&com_interface->pub_transition_event, &msg); } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl_lifecycle/src/com_interface.h b/rcl_lifecycle/src/com_interface.h index 944ab83326..6eb8746672 100644 --- a/rcl_lifecycle/src/com_interface.h +++ b/rcl_lifecycle/src/com_interface.h @@ -15,7 +15,7 @@ #ifndef COM_INTERFACE_H_ #define COM_INTERFACE_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -51,7 +51,7 @@ rcl_lifecycle_com_interface_publish_notification( rcl_lifecycle_com_interface_t * com_interface, const rcl_lifecycle_state_t * start, const rcl_lifecycle_state_t * goal); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl_lifecycle/src/default_state_machine.c b/rcl_lifecycle/src/default_state_machine.c index 39333093c9..13bd6836ec 100644 --- a/rcl_lifecycle/src/default_state_machine.c +++ b/rcl_lifecycle/src/default_state_machine.c @@ -27,7 +27,7 @@ #include "default_state_machine.h" // NOLINT #include "states.h" // NOLINT -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -476,6 +476,6 @@ rcl_lifecycle_init_default_state_machine( return RCL_RET_ERROR; } -#if __cplusplus +#ifdef __cplusplus } #endif // extern "C" diff --git a/rcl_lifecycle/src/default_state_machine.h b/rcl_lifecycle/src/default_state_machine.h index 0bcfa77f87..993541ea4a 100644 --- a/rcl_lifecycle/src/default_state_machine.h +++ b/rcl_lifecycle/src/default_state_machine.h @@ -21,7 +21,7 @@ #include "rcl_lifecycle/data_types.h" #include "rcl_lifecycle/visibility_control.h" -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -32,7 +32,7 @@ rcl_ret_t rcl_lifecycle_init_default_state_machine( rcl_lifecycle_state_machine_t * state_machine, const rcl_allocator_t * allocator); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/rcl_lifecycle/src/rcl_lifecycle.c b/rcl_lifecycle/src/rcl_lifecycle.c index 8246101323..cff756f51b 100644 --- a/rcl_lifecycle/src/rcl_lifecycle.c +++ b/rcl_lifecycle/src/rcl_lifecycle.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -360,6 +360,6 @@ rcl_print_state_machine(const rcl_lifecycle_state_machine_t * state_machine) } } } -#if __cplusplus +#ifdef __cplusplus } #endif // extern "C" diff --git a/rcl_lifecycle/src/states.h b/rcl_lifecycle/src/states.h index 6de31739ba..0da6689616 100644 --- a/rcl_lifecycle/src/states.h +++ b/rcl_lifecycle/src/states.h @@ -18,7 +18,7 @@ #include "rcl_lifecycle/data_types.h" #include "rcl_lifecycle/visibility_control.h" -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -44,7 +44,7 @@ extern const rcl_lifecycle_transition_t rcl_transition_shutdown; extern const rcl_lifecycle_transition_t rcl_transition_activate; extern const rcl_lifecycle_transition_t rcl_transition_deactivate; -#if __cplusplus +#ifdef __cplusplus } #endif // extern "C" diff --git a/rcl_lifecycle/src/transition_map.c b/rcl_lifecycle/src/transition_map.c index 99d9f3d975..c6fb76e29a 100644 --- a/rcl_lifecycle/src/transition_map.c +++ b/rcl_lifecycle/src/transition_map.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -197,6 +197,6 @@ rcl_lifecycle_get_transitions( return NULL; } -#if __cplusplus +#ifdef __cplusplus } #endif