Change #if to #ifdef. (#229)

Needed because you can't use preprocessor on undefined variables in
MISRA.
This commit is contained in:
Michael Carroll 2018-05-01 17:25:24 -05:00 committed by GitHub
parent 5142a8a4b4
commit e8491ab8ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
48 changed files with 95 additions and 95 deletions

View file

@ -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

View file

@ -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

View file

@ -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 @@ fail:
return RCL_RET_ERROR;
}
#if __cplusplus
#ifdef __cplusplus
}
#endif // extern "C"

View file

@ -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

View file

@ -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"

View file

@ -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"

View file

@ -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