Move elements() to nasmlib.h

Move elements() to nasmlib.h; that is the best place for this kind of
utility macros.
This commit is contained in:
H. Peter Anvin 2007-11-08 19:30:22 -08:00
parent c84f1b927b
commit 6a6eafdcee
2 changed files with 10 additions and 13 deletions

13
nasm.h
View File

@ -961,19 +961,6 @@ enum special_tokens {
SPECIAL_ENUM_LIMIT
};
/*
* -----
* Other
* -----
*/
/*
* This is a useful #define which I keep meaning to use more often:
* the number of elements of a statically defined array.
*/
#define elements(x) ( sizeof(x) / sizeof(*(x)) )
/*
* -----
* Global modes

View File

@ -162,6 +162,16 @@ void standard_extension(char *inname, char *outname, char *extension,
efunc error);
#endif
/*
* Utility macros...
*
* This is a useful #define which I keep meaning to use more often:
* the number of elements of a statically defined array.
*/
#define elements(x) ( sizeof(x) / sizeof(*(x)) )
/*
* some handy macros that will probably be of use in more than one
* output format: convert integers into little-endian byte packed