0d23060b56ee6ace79a1a44a63c40c924a7e99f0
[taskasaur.git] / headers / utils.h
1
2 #ifndef __UTILS_H__
3 #define __UTILS_H__
4
5 #define \
6 array_length(type, array)               \
7 ({                                      \
8     type* m_arr;                        \
9     int m_len;                          \
10                                         \
11     m_arr = (type*)array;               \
12     m_len = 0;                          \
13                                         \
14     while (m_arr[m_len] != 0) {         \
15         m_len += 1;                     \
16     }                                   \
17                                         \
18     m_len;                              \
19 })
20
21 #endif