diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-11-08 19:30:22 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-11-08 19:30:22 -0800 |
commit | 6a6eafdcee2f454eb6680b5919b9365bb2e827f0 (patch) | |
tree | 93bf6c07ef29df9f36e7e95aa87539efe77e7f47 /nasmlib.h | |
parent | c84f1b927b0f0b1c9f0489cd4aa2667383f3e56f (diff) | |
download | nasm-6a6eafdcee2f454eb6680b5919b9365bb2e827f0.tar.gz |
Move elements() to nasmlib.h
Move elements() to nasmlib.h; that is the best place for this kind of
utility macros.
Diffstat (limited to 'nasmlib.h')
-rw-r--r-- | nasmlib.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -163,6 +163,16 @@ void standard_extension(char *inname, char *outname, char *extension, #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 * format in memory |