There are a few cases in which nested functions are an helpful way to write
code, as this is explained in 'script/nested-func-to-macro.sh'. However,
some compiler do not support them (like clang), so this patch proposes an
elegant solution, where developers can get the benefit of them, but for
users they are automatically converted to C macro if needed.
The advantage of this solution is that we keep the code simple, there is no
hack in the source (like #ifdef and code duplication), yet still having the
full advantages.
The translation is done according to what have been detected by configure
(see the WM_PROG_CC_NESTEDFUNC macro) so that user has nothing to do.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Some compiler support C11 standard by default, some need an explicit
option, and some don't support at all; this new macro only tries to enable
support if possible, the actual feature support being done by other checks
on case-by-case
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>