mirror of
https://github.com/systemd/systemd.git
synced 2025-01-03 05:18:09 +03:00
sd-bus-vtable: add dummy macro to support compile without GNU extension
If SD_BUS_METHOD_WITH_ARGS() is set with SD_BUS_NO_ARGS and/or SD_BUS_NO_RESULT, then it introduces _SD_VARARGS_FOREACH_EVEN(_SD_ECHO, NULL) -> _SD_VARARGS_FOREACH_SEQ(_01, …, _50, NULL) Hence, the variadic argument `...` in _SD_VARARGS_FOREACH_SEQ() has no argument, but it is not allowed if built without GNU extension, e.g. -std=c11. Let's introduce one more unused dummy argument to support such situation.
This commit is contained in:
parent
2548ce6a30
commit
e10409ad55
@ -208,6 +208,7 @@ struct sd_bus_vtable {
|
||||
_41, _42, _43, _44, _45, _46, _47, _48, _49, _50, \
|
||||
NAME, ...) NAME
|
||||
|
||||
#define _SD_VARARGS_FOREACH_EVEN_00(FN)
|
||||
#define _SD_VARARGS_FOREACH_EVEN_01(FN, X) FN(X)
|
||||
#define _SD_VARARGS_FOREACH_EVEN_02(FN, X, Y) FN(X)
|
||||
#define _SD_VARARGS_FOREACH_EVEN_04(FN, X, Y, ...) FN(X) _SD_VARARGS_FOREACH_EVEN_02(FN, __VA_ARGS__)
|
||||
@ -261,9 +262,11 @@ struct sd_bus_vtable {
|
||||
_SD_VARARGS_FOREACH_EVEN_08, _SD_VARARGS_FOREACH_EVEN_07, \
|
||||
_SD_VARARGS_FOREACH_EVEN_06, _SD_VARARGS_FOREACH_EVEN_05, \
|
||||
_SD_VARARGS_FOREACH_EVEN_04, _SD_VARARGS_FOREACH_EVEN_03, \
|
||||
_SD_VARARGS_FOREACH_EVEN_02, _SD_VARARGS_FOREACH_EVEN_01) \
|
||||
_SD_VARARGS_FOREACH_EVEN_02, _SD_VARARGS_FOREACH_EVEN_01, \
|
||||
_SD_VARARGS_FOREACH_EVEN_00) \
|
||||
(FN, __VA_ARGS__)
|
||||
|
||||
#define _SD_VARARGS_FOREACH_ODD_00(FN)
|
||||
#define _SD_VARARGS_FOREACH_ODD_01(FN, X)
|
||||
#define _SD_VARARGS_FOREACH_ODD_02(FN, X, Y) FN(Y)
|
||||
#define _SD_VARARGS_FOREACH_ODD_04(FN, X, Y, ...) FN(Y) _SD_VARARGS_FOREACH_ODD_02(FN, __VA_ARGS__)
|
||||
@ -317,7 +320,8 @@ struct sd_bus_vtable {
|
||||
_SD_VARARGS_FOREACH_ODD_08, _SD_VARARGS_FOREACH_ODD_07, \
|
||||
_SD_VARARGS_FOREACH_ODD_06, _SD_VARARGS_FOREACH_ODD_05, \
|
||||
_SD_VARARGS_FOREACH_ODD_04, _SD_VARARGS_FOREACH_ODD_03, \
|
||||
_SD_VARARGS_FOREACH_ODD_02, _SD_VARARGS_FOREACH_ODD_01) \
|
||||
_SD_VARARGS_FOREACH_ODD_02, _SD_VARARGS_FOREACH_ODD_01, \
|
||||
_SD_VARARGS_FOREACH_ODD_00) \
|
||||
(FN, __VA_ARGS__)
|
||||
|
||||
#define SD_BUS_ARGS(...) __VA_ARGS__
|
||||
|
Loading…
Reference in New Issue
Block a user