Skip to content
Commit aae51921 authored by Trond Einar Snekvik's avatar Trond Einar Snekvik Committed by Carles Cufí
Browse files

sys: util: Accept empty FOR_EACH



The ## part of ##__VA_ARGS__ in the Z_FOR_EACH_ENGINE macro technically
breaks the invocation of empty FOR_EACH sequences, as the empty
__VA_ARGS__ gets squashed with in the invocation of Z_FOR_LOOP_1() in
Z_FOR_LOOP_2(), which makes the macro only pass 4 arguments to
Z_FOR_LOOP_1.

This breaks IntelliSense in Microsoft's C/C++ extension for VS Code,
which is strict about the amount of arguments you can pass to a variadic
macro.

Signed-off-by: default avatarKrzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Signed-off-by: default avatarTrond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
parent 2a93e06f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment