5 #define SCX_ALIGN(d, a) ( ( (int)(( (d)-1 )/(a)) + 1 ) * (a) )
6 #define SCX_QALIGN(d, a) ( ( (d) + ((a) - 1) ) & ~((a) - 1) )
9 #define SCX_BIT(n) ( 1 << (n) )
12 #define SCX_ARRAY_LEN(a) (sizeof(a)/sizeof(a[0]))
15 #define SCX_FOR(index, begin, _end) \
16 for (size_t index = begin, end = _end; \
20 // for stl vector etc.
21 #define foreach_linear(index, container) \
22 for (size_t index = 0; \
23 index < (container).size(); \
26 #define forrange_linear(index, begin, end) \
27 for (size_t index = begin; \
32 #define foreach_iterator(iter_t, iter, container) \
33 for (iter_t iter = container.begin(); \
34 iter < container.end(); \
37 #define forrange_iterator(iter_t, iter, begin, end) \
38 for (iter_t iter = begin; \