From e494eb8217c7b67f5f187b0c5946a2ac57181d41 Mon Sep 17 00:00:00 2001 From: Dan Rose Date: Fri, 15 May 2020 15:54:29 -0500 Subject: [PATCH 1/2] Consolidate macro duplication Signed-off-by: Dan Rose --- rcl/include/rcl/macros.h | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/rcl/include/rcl/macros.h b/rcl/include/rcl/macros.h index cbf5b89d0..d23e6404a 100644 --- a/rcl/include/rcl/macros.h +++ b/rcl/include/rcl/macros.h @@ -15,22 +15,10 @@ #ifndef RCL__MACROS_H_ #define RCL__MACROS_H_ -#ifdef __cplusplus -extern "C" -{ -#endif +#include "rcutils/macros.h" -#ifndef _WIN32 -/// Ignored return values of functions with this macro will emit a warning. -# define RCL_WARN_UNUSED __attribute__((warn_unused_result)) -#else -# define RCL_WARN_UNUSED _Check_return_ -#endif +#define RCL_WARN_UNUSED RCUTILS_WARN_UNUSED -#define RCL_UNUSED(x) (void)(x) - -#ifdef __cplusplus -} -#endif +#define RCL_UNUSED(x) RCUTILS_UNUSED(x) #endif // RCL__MACROS_H_ From b8f11aa0ef7672fed01d298d5915fbb619ccf341 Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Thu, 23 Jul 2020 13:48:52 -0700 Subject: [PATCH 2/2] readd extern C Signed-off-by: Dirk Thomas --- rcl/include/rcl/macros.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rcl/include/rcl/macros.h b/rcl/include/rcl/macros.h index 3147700ca..4df9ff427 100644 --- a/rcl/include/rcl/macros.h +++ b/rcl/include/rcl/macros.h @@ -17,9 +17,18 @@ #include "rcutils/macros.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /// Ignored return values of functions with this macro will emit a warning. #define RCL_WARN_UNUSED RCUTILS_WARN_UNUSED #define RCL_UNUSED(x) RCUTILS_UNUSED(x) +#ifdef __cplusplus +} +#endif + #endif // RCL__MACROS_H_