From 38f51167915998a4c795bb385b8f3505a15c42e8 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 24 Feb 2020 15:14:55 +0100 Subject: [PATCH] Library: ARRAY_SIZE --- lib/util.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/util.h b/lib/util.h index f7fe61d..6b9f4ba 100644 --- a/lib/util.h +++ b/lib/util.h @@ -24,6 +24,7 @@ typedef int32_t s32; #define MIN(x,y) ((x) < (y) ? (x) : (y)) #define MAX(x,y) ((x) > (y) ? (x) : (y)) #define CLAMP(x,min,max) ({ typeof(x) _t=x; (_t < min) ? min : (_t > max) ? max : _t; }) +#define ARRAY_SIZE(ary) (sizeof(ary)/sizeof((ary)[0])) #define UNUSED __attribute__((unused)) -- 2.39.2