From a26008be93574e2eea29342f65f4e15c8df9c0b3 Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Tue, 5 Jan 2016 11:50:17 +0100 Subject: [PATCH] gmio_core: add utility macro GMIO_ARRAY_SIZE() --- src/gmio_core/global.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gmio_core/global.h b/src/gmio_core/global.h index 4869101..6e37baa 100644 --- a/src/gmio_core/global.h +++ b/src/gmio_core/global.h @@ -231,5 +231,8 @@ typedef double gmio_float64_t; # define GMIO_PRAGMA_MSVC_WARNING_POP() #endif +/*! Expands to the size(item count) of an array */ +#define GMIO_ARRAY_SIZE(array) sizeof(array) / sizeof(*array) + #endif /* GMIO_GLOBAL_H */ /*! @} */