From: Nick Clifton Date: Sun, 3 Sep 2000 17:35:07 +0000 (+0000) Subject: Add ARRAY_SIZE macro from egcs version X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b18903cb91a18943fa8a8f75cdb2e5ee2a77936f;p=binutils-gdb.git Add ARRAY_SIZE macro from egcs version --- diff --git a/include/ChangeLog b/include/ChangeLog index 6f570ac95f5..c49acf04d86 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,7 @@ +2000-08-24 Greg McGary + + * libiberty.h (ARRAY_SIZE): New macro. + 2000-08-08 Jason Eckhardt * opcode/i860.h: Small formatting adjustments. diff --git a/include/libiberty.h b/include/libiberty.h index 476e0165b3e..e6eb34739ce 100644 --- a/include/libiberty.h +++ b/include/libiberty.h @@ -200,6 +200,8 @@ extern int asprintf PARAMS ((char **, const char *, ...)) ATTRIBUTE_PRINTF_2; extern int vasprintf PARAMS ((char **, const char *, va_list)) ATTRIBUTE_PRINTF(2,0); +#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0])) + #ifdef __cplusplus } #endif