From aa3288505569433200bfa311ff12d29684a14374 Mon Sep 17 00:00:00 2001 From: pyBlob Date: Mon, 20 Feb 2017 22:24:45 +0100 Subject: Syntax for defines that is also unterstood by the GNU C/C++ compilers. (#5397) --- src/systemd/sd-bus-vtable.h | 54 +++++++++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/src/systemd/sd-bus-vtable.h b/src/systemd/sd-bus-vtable.h index e8f84eb545..3563a2b126 100644 --- a/src/systemd/sd-bus-vtable.h +++ b/src/systemd/sd-bus-vtable.h @@ -86,18 +86,26 @@ struct sd_bus_vtable { { \ .type = _SD_BUS_VTABLE_START, \ .flags = _flags, \ - .x.start.element_size = sizeof(sd_bus_vtable), \ + .x = { \ + .start = { \ + .element_size = sizeof(sd_bus_vtable) \ + }, \ + }, \ } #define SD_BUS_METHOD_WITH_OFFSET(_member, _signature, _result, _handler, _offset, _flags) \ { \ .type = _SD_BUS_VTABLE_METHOD, \ .flags = _flags, \ - .x.method.member = _member, \ - .x.method.signature = _signature, \ - .x.method.result = _result, \ - .x.method.handler = _handler, \ - .x.method.offset = _offset, \ + .x = { \ + .method = { \ + .member = _member, \ + .signature = _signature, \ + .result = _result, \ + .handler = _handler, \ + .offset = _offset, \ + }, \ + }, \ } #define SD_BUS_METHOD(_member, _signature, _result, _handler, _flags) \ SD_BUS_METHOD_WITH_OFFSET(_member, _signature, _result, _handler, 0, _flags) @@ -106,29 +114,41 @@ struct sd_bus_vtable { { \ .type = _SD_BUS_VTABLE_SIGNAL, \ .flags = _flags, \ - .x.signal.member = _member, \ - .x.signal.signature = _signature, \ + .x = { \ + .signal = { \ + .member = _member, \ + .signature = _signature, \ + }, \ + }, \ } #define SD_BUS_PROPERTY(_member, _signature, _get, _offset, _flags) \ { \ .type = _SD_BUS_VTABLE_PROPERTY, \ .flags = _flags, \ - .x.property.member = _member, \ - .x.property.signature = _signature, \ - .x.property.get = _get, \ - .x.property.offset = _offset, \ + .x = { \ + .property = { \ + .member = _member, \ + .signature = _signature, \ + .get = _get, \ + .offset = _offset, \ + }, \ + }, \ } #define SD_BUS_WRITABLE_PROPERTY(_member, _signature, _get, _set, _offset, _flags) \ { \ .type = _SD_BUS_VTABLE_WRITABLE_PROPERTY, \ .flags = _flags, \ - .x.property.member = _member, \ - .x.property.signature = _signature, \ - .x.property.get = _get, \ - .x.property.set = _set, \ - .x.property.offset = _offset, \ + .x = { \ + .property = { \ + .member = _member, \ + .signature = _signature, \ + .get = _get, \ + .set = _set, \ + .offset = _offset, \ + }, \ + }, \ } #define SD_BUS_VTABLE_END \ -- cgit v1.2.3-54-g00ecf