From 601212430b2026a32aeb610f834532f4eb9beb36 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 24 Sep 2021 12:45:24 +0100 Subject: [PATCH] Add ARRAY_SIZE macro Signed-off-by: falkTX --- distrho/src/DistrhoDefines.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/distrho/src/DistrhoDefines.h b/distrho/src/DistrhoDefines.h index afff900e..ffd407f1 100644 --- a/distrho/src/DistrhoDefines.h +++ b/distrho/src/DistrhoDefines.h @@ -199,6 +199,9 @@ private: \ # pragma warning(disable:4244) /* possible loss of data */ #endif +/* Useful macros */ +#define ARRAY_SIZE(ARRAY) sizeof(ARRAY)/sizeof(ARRAY[0]) + /* Useful typedefs */ typedef unsigned char uchar; typedef unsigned short int ushort;