forked from enlightenment/efl
Eina: Added EINA_C_ARRAY_LENGTH.
This macro returns the length of a standard C array. SVN revision: 67589
This commit is contained in:
parent
c37e388c4a
commit
92d70212c5
|
@ -206,3 +206,9 @@
|
|||
2011-12-30 Vincent Torri
|
||||
|
||||
* Fix Eina_RWLock code on Windows > XP.
|
||||
|
||||
2012-01-29 Tom Hacohen
|
||||
|
||||
* Added EINA_C_ARRAY_LENGTH, a macro that returns the length of a
|
||||
standard C array.
|
||||
|
||||
|
|
|
@ -275,6 +275,16 @@ typedef void (*Eina_Free_Cb)(void *data);
|
|||
*/
|
||||
#define EINA_FREE_CB(Function) ((Eina_Free_Cb)Function)
|
||||
|
||||
/**
|
||||
* @def EINA_C_ARRAY_LENGTH
|
||||
* Macro to return the array length of a standard c array.
|
||||
* For example:
|
||||
* int foo[] = { 0, 1, 2, 3 };
|
||||
* would return 4 and not 4 * sizeof(int).
|
||||
* @since 1.2.0
|
||||
*/
|
||||
#define EINA_C_ARRAY_LENGTH(arr) (sizeof(arr) / sizeof((arr)[0]))
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue