chiark / gitweb /
Syntax for defines that is also unterstood by the GNU C/C++ compilers. (#5397)
authorpyBlob <laqueray@gmail.com>
Mon, 20 Feb 2017 21:24:45 +0000 (22:24 +0100)
committerSven Eden <yamakuzure@gmx.net>
Mon, 17 Jul 2017 15:58:36 +0000 (17:58 +0200)
src/systemd/sd-bus-vtable.h

index e8f84eb..3563a2b 100644 (file)
@@ -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                                               \