X-Git-Url: http://git.pond.sub.org/?p=empserver;a=blobdiff_plain;f=include%2Fmisc.h;h=b580633ae904759de6cc9dc60533a1f9d256655d;hp=7b428f091d39f21815f873d538e4497d2878ed48;hb=5e458599795dd4e7d1ffbbb5766d9fb106eb8d27;hpb=50d84c025b44b571552648fcfdadef85e68f786a diff --git a/include/misc.h b/include/misc.h index 7b428f091..b580633ae 100644 --- a/include/misc.h +++ b/include/misc.h @@ -29,7 +29,7 @@ * * Known contributors to this file: * Doug Hay, 1998 - * Markus Armbruster, 2004-2014 + * Markus Armbruster, 2004-2020 */ #ifndef MISC_H @@ -89,6 +89,11 @@ extern void (*oops_handler)(void); #define BUILD_ASSERT(cond) \ ((void)BUILD_ASSERT_ONE(cond)) +/* + * Number of elements in ARRAY. + */ +#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0])) + void exit_nomem(void) ATTRIBUTE((noreturn)); /* return codes from command routines */