File 1021-Revert-macro-terminate-the-temporary-VA_ARGS_FOREACH.patch of Package systemd.38170
From 66b53a50e2371ff3da89fdde5bdc9627b3ae050c Mon Sep 17 00:00:00 2001
From: Franck Bui <fbui@suse.com>
Date: Wed, 14 Feb 2024 11:54:29 +0100
Subject: [PATCH 5012/5012] Revert "macro: terminate the temporary
VA_ARGS_FOREACH() array with a sentinel"
This reverts commit d44fe47f2ea48fd6da83d1748ff37f46df8b4ddd.
---
src/basic/macro.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/basic/macro.h b/src/basic/macro.h
index 53ea59890c..79b4e94282 100644
--- a/src/basic/macro.h
+++ b/src/basic/macro.h
@@ -437,10 +437,10 @@ assert_cc(sizeof(dummy_t) == 0);
/* Iterate through each variadic arg. All must be the same type as 'entry' or must be implicitly
* convertible. The iteration variable 'entry' must already be defined. */
#define VA_ARGS_FOREACH(entry, ...) \
- _VA_ARGS_FOREACH(entry, UNIQ_T(_entries_, UNIQ), UNIQ_T(_current_, UNIQ), UNIQ_T(_va_sentinel_, UNIQ), ##__VA_ARGS__)
-#define _VA_ARGS_FOREACH(entry, _entries_, _current_, _va_sentinel_, ...) \
- for (typeof(entry) _va_sentinel_[1] = {}, _entries_[] = { __VA_ARGS__ __VA_OPT__(,) _va_sentinel_[0] }, *_current_ = _entries_; \
- ((long)(_current_ - _entries_) < (long)(ELEMENTSOF(_entries_) - 1)) && ({ entry = *_current_; true; }); \
+ _VA_ARGS_FOREACH(entry, UNIQ_T(_entries_, UNIQ), UNIQ_T(_current_, UNIQ), ##__VA_ARGS__)
+#define _VA_ARGS_FOREACH(entry, _entries_, _current_, ...) \
+ for (typeof(entry) _entries_[] = { __VA_ARGS__ }, *_current_ = _entries_; \
+ ((long)(_current_ - _entries_) < (long)ELEMENTSOF(_entries_)) && ({ entry = *_current_; true; }); \
_current_++)
#include "log.h"
--
2.35.3