mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-25 16:02:33 +01:00
The new macro 'wlengthof' returns the number of elements for which a local array have been defined, which makes code easier to read than the previous [sizeof() / sizeof([0]) ] construct. The macro includes a static assertion to stop compilation if it is being used on a pointer, for which we cannot know the size of the array, to avoid generating dummy result. This can work only with C11 which standardised the static assertions. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>