From b9e458b184d3a0a8fe87fd3f1a43eb241702cd78 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sun, 5 Jul 2020 18:15:34 +0200 Subject: [PATCH] shared: add NM_N_ELEMENTS() macro --- shared/nm-std-aux/nm-std-aux.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared/nm-std-aux/nm-std-aux.h b/shared/nm-std-aux/nm-std-aux.h index af58741d11..6b1483128a 100644 --- a/shared/nm-std-aux/nm-std-aux.h +++ b/shared/nm-std-aux/nm-std-aux.h @@ -109,6 +109,8 @@ /*****************************************************************************/ +#define NM_N_ELEMENTS(arr) (sizeof (arr) / sizeof ((arr)[0])) + #define NM_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2 #define NM_PASTE(identifier1,identifier2) NM_PASTE_ARGS (identifier1, identifier2)