diff --git a/0001-Copy-FOREACH_STRING-fix-from-systemd.patch b/0001-Copy-FOREACH_STRING-fix-from-systemd.patch new file mode 100644 index 0000000..d69a7b8 --- /dev/null +++ b/0001-Copy-FOREACH_STRING-fix-from-systemd.patch @@ -0,0 +1,40 @@ +From 90d4abd26bfd7e7f2e84873037293074bbc25be9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Thu, 21 Feb 2019 11:27:33 +0100 +Subject: [PATCH] Copy FOREACH_STRING fix from systemd + +This is a copy of +https://github.com/systemd/systemd/commit/66a64081f82dfad90f2f9394a477820a2e3e6510. +--- + src/util.h | 15 ++++----------- + 1 file changed, 4 insertions(+), 11 deletions(-) + +diff --git a/src/util.h b/src/util.h +index feefeaa97a..dcc8ff3995 100644 +--- a/src/util.h ++++ b/src/util.h +@@ -552,17 +552,10 @@ static inline size_t strlen_null(const char *s) { + + #define STRV_MAKE(...) ((char**) ((const char*[]) { __VA_ARGS__, NULL })) + +-#define FOREACH_STRING(x, ...) \ +- for (char **_l = ({ \ +- char **_ll = STRV_MAKE(__VA_ARGS__); \ +- x = _ll ? _ll[0] : NULL; \ +- _ll; \ +- }); \ +- _l && *_l; \ +- x = ({ \ +- _l ++; \ +- _l[0]; \ +- })) ++#define FOREACH_STRING(x, y, ...) \ ++ for (char **_l = STRV_MAKE(({ x = y; }), ##__VA_ARGS__); \ ++ x; \ ++ x = *(++_l)) + + #define STR_IN_SET(x, ...) strv_contains(STRV_MAKE(__VA_ARGS__), x) + +-- +2.19.2 + diff --git a/casync.spec b/casync.spec index 663ab19..85a4137 100644 --- a/casync.spec +++ b/casync.spec @@ -14,6 +14,8 @@ Source0: https://github.com/keszybz/casync/archive/%{?commit}/casync-%{sh Source0: https://github.com/systemd/casync/archive/v%{version}/%{name}-%{version}.tar.gz %endif +Patch0001: 0001-Copy-FOREACH_STRING-fix-from-systemd.patch + BuildRequires: meson BuildRequires: gcc BuildRequires: pkgconfig(libudev)