summaryrefslogtreecommitdiff
path: root/nasmlib.h
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2010-06-03 22:04:36 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2010-06-03 23:17:21 +0400
commita73192497830167823d50ffb829f763ec270e7ef (patch)
tree397b0dd6ae437e40d055e130241d81e3676f2f2a /nasmlib.h
parent3b4e86b1ddc272cdf84f3e61486918100bb5e00f (diff)
downloadnasm-a73192497830167823d50ffb829f763ec270e7ef.tar.gz
nasmlib: Rename elements() macro to ARRAY_SIZE
ARRAY_SIZE is a well known name pointing out that we're dealing with array in macro argument. Also to be on a safe side prefix_name helper should check the index been in bounds more precisely. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'nasmlib.h')
-rw-r--r--nasmlib.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/nasmlib.h b/nasmlib.h
index 02876c74..2c335e11 100644
--- a/nasmlib.h
+++ b/nasmlib.h
@@ -239,8 +239,7 @@ void standard_extension(char *inname, char *outname, char *extension);
* 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)) )
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
/*
* List handling