Create global macro NELEMS to replace countof macro defined just in main.c.

svn path=/trunk/yasm/; revision=592
This commit is contained in:
Peter Johnson 2002-04-21 18:55:19 +00:00
parent 58abdf1cd1
commit b9541920f1
5 changed files with 19 additions and 14 deletions

5
util.h
View file

@ -147,6 +147,11 @@ void xfree(/*@only@*/ /*@out@*/ /*@null@*/ void *p);
d += d>>8; \
} while (0)
/* Get the number of elements in an array. */
#ifndef NELEMS
#define NELEMS(array) (sizeof(array) / sizeof(array[0]))
#endif
#include "coretype.h"
#include "valparam.h"