mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-03-19 18:00:23 +08:00
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:
parent
c84f1b927b
commit
6a6eafdcee
13
nasm.h
13
nasm.h
@ -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
|
||||
|
10
nasmlib.h
10
nasmlib.h
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user