From 148b11bd33c91c00177d41080ba9c91a700270ae Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Wed, 15 Feb 2017 17:33:03 +0100 Subject: [PATCH] Add countof macro for arrays --- src/blupi.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/blupi.h b/src/blupi.h index 8aa0c52..1be8b96 100644 --- a/src/blupi.h +++ b/src/blupi.h @@ -34,6 +34,12 @@ typedef Sint32 LPARAM; #define LOWORD(l) ((Uint16) (((Uint32) (l)) & 0xffff)) #define HIWORD(l) ((Uint16) ((((Uint32) (l)) >> 16) & 0xffff)) +#ifdef _WIN32 +#define countof(a) _countof (a) +#else /* _WIN32 */ +#define countof(a) (sizeof (a) / sizeof (*a)) +#endif /* !_WIN32 */ + #define MAX_PATH 260 #define VK_END 0x23