From f80cf7cd9bd05e53c278cd432caf98a63e2e3011 Mon Sep 17 00:00:00 2001 From: Daniel Lehman Date: Thu, 1 Sep 2016 10:27:40 -0700 Subject: [PATCH] include: Add _countof macro. Signed-off-by: Daniel Lehman --- include/msvcrt/stdlib.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/msvcrt/stdlib.h b/include/msvcrt/stdlib.h index 2c213ac8d84..a3251878b0d 100644 --- a/include/msvcrt/stdlib.h +++ b/include/msvcrt/stdlib.h @@ -60,6 +60,9 @@ typedef struct _ldiv_t { __msvcrt_long rem; } ldiv_t; + +#define _countof(x) (sizeof(x)/sizeof((x)[0])) + #define __max(a,b) (((a) > (b)) ? (a) : (b)) #define __min(a,b) (((a) < (b)) ? (a) : (b)) #ifndef __cplusplus -- 2.17.0