(backport) strv: rework FOREACH_STRING() macro sandbox/adrians/upgrade-to-234
authorLennart Poettering <lennart@poettering.net>
Tue, 15 Jan 2019 23:13:38 +0000 (00:13 +0100)
committerAdrian Szyndela <adrian.s@samsung.com>
Wed, 26 Feb 2020 10:39:00 +0000 (11:39 +0100)
commit71dda51708c0f9cafff337fda0a02322981dc48c
treea14597ecdddbca81eefef94e0963c0f42f22cc72
parent7d0be1e0f8a2a104464778ee36cd56e373784d15
(backport) strv: rework FOREACH_STRING() macro

So it's apparently problematic that we use STRV_MAKE() (i.e. a compound
initializer) outside of the {} block we use it in (and that includes
outside of the ({}) block, too). Hence, let's rework the macro to not
need that.

This also makes the macro shorter, which is definitely a good and more
readable. Moreover, it will now complain if the iterator is a "char*"
instead of a "const char*", which is good too.

Fixes: #11394
Change-Id: Ibc21cdd5583c3b6a079b8691bbac5e076819432a
src/basic/strv.h