diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-09-28 21:14:50 +0200 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2020-10-03 19:05:40 +0200 |
commit | 42946ec113e8ae6d6bc114dbd90e9721f464abfb (patch) | |
tree | 3b30fc9a612905cd4e2b868804ac81cd2c90b403 /Macros.h | |
parent | b82a13c6ba48eb8711071342bec80798aca5de1c (diff) |
Introduce ARRAYSIZE
Diffstat (limited to 'Macros.h')
-rw-r--r-- | Macros.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -13,6 +13,10 @@ #define CLAMP(x, low, high) (((x) > (high)) ? (high) : MAXIMUM(x, low)) #endif +#ifndef ARRAYSIZE +#define ARRAYSIZE(x) (sizeof(x) / sizeof((x)[0])) +#endif + #ifdef __GNUC__ // defined by GCC and Clang #define ATTR_FORMAT(type, index, check) __attribute__((format (type, index, check))) |