Allow logger to be passed into macros as a reference (#423)

* Remove reference for logger so it can be rclcpp::Logger &

This is the type when captured by reference in a lambda; windows can't
resolve it without.

* Wrap lines
This commit is contained in:
dhood 2017-12-05 15:12:20 -08:00 committed by GitHub
parent 6129a12df5
commit d823982f22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -85,7 +85,9 @@ def is_supported_feature_combination(feature_combination):
* \param ... The format string, followed by the variable arguments for the format string * \param ... The format string, followed by the variable arguments for the format string
*/ */
#define RCLCPP_@(severity)@(suffix)(logger, @(''.join([p + ', ' for p in get_macro_parameters(feature_combination).keys()]))...) \ #define RCLCPP_@(severity)@(suffix)(logger, @(''.join([p + ', ' for p in get_macro_parameters(feature_combination).keys()]))...) \
static_assert(::std::is_same<decltype(logger), ::rclcpp::Logger>::value, "First argument to logging macros must be an rclcpp::Logger"); \ static_assert( \
::std::is_same<std::remove_reference<decltype(logger)>::type, ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
RCUTILS_LOG_@(severity)@(suffix)_NAMED( \ RCUTILS_LOG_@(severity)@(suffix)_NAMED( \
@{params = get_macro_parameters(feature_combination).keys()}@ @{params = get_macro_parameters(feature_combination).keys()}@
@[ if params]@ @[ if params]@