added define get an array element count

pull/1/head
Heiko Hund 2009-02-02 15:49:08 +00:00
parent 66280bca2c
commit 4003caca8a
1 changed files with 2 additions and 0 deletions

2
main.h
View File

@ -58,6 +58,8 @@ struct security_attributes
SECURITY_DESCRIPTOR sd;
};
/* Return the number of elements in an array */
#define ELEMENTS(x) sizeof(x)/sizeof(*(x))
/* clear an object */
#define CLEAR(x) memset(&(x), 0, sizeof(x))