lib: make g++ happy with plugin-dev.h macros
g++ doesn't like the syntax used for assigning structures in the plugin
macros:
/tmp/babeltrace/include/babeltrace2/plugin/plugin-dev.h:599:3: error: expected primary-expression before ‘.’ token
.value._attr_name = _x, \
^
/tmp/babeltrace/include/babeltrace2/plugin/plugin-dev.h:871:2: note: in expansion of macro ‘__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE’
__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_msg_iter_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INIT_METHOD, _id, _comp_class_id, source, _x)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/babeltrace/include/babeltrace2/plugin/plugin-dev.h:1356:2: note: in expansion of macro ‘BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_WITH_ID’
BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_WITH_ID(auto, _name, _x)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
can.cpp:829:1: note: in expansion of macro ‘BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD’
BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD(CANSource, can_iter_init);
^
Changing
.value._attr_name = _x
to
.value = { ._attr_name = _x }
makes it work. There are a few instances of this, I changed all I found.
Built-tested with gcc 7.4.0 and clang-9, and verified that a plugin compiled
with g++ 7.4.0 works.
Change-Id: I17cb4edf1082003dc0bb9d0fae906c391daf3da4
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1964
Reviewed-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
This page took 0.024854 seconds and 4 git commands to generate.