always pass vectors by reference
[cvector.git] / macros.h
blob724bf8e4a133e81c7ab88872fd860d85f15a3b50
1 #ifndef MACROS_H_
2 #define MACROS_H_
4 #define PRIMITIVE_CAT(a, b) a##b
5 #define CAT(a, b) PRIMITIVE_CAT(a, b)
6 #define PRIMITIVE_CAT_(a, b) a##_##b
7 #define CAT_(a, b) PRIMITIVE_CAT_(a, b)
9 #define EVAL(...) __EVAL1024(__VA_ARGS__)
10 #define __EVAL1024(...) __EVAL512(__EVAL512(__VA_ARGS__))
11 #define __EVAL512(...) __EVAL256(__EVAL256(__VA_ARGS__))
12 #define __EVAL256(...) __EVAL128(__EVAL128(__VA_ARGS__))
13 #define __EVAL128(...) __EVAL64(__EVAL64(__VA_ARGS__))
14 #define __EVAL64(...) __EVAL32(__EVAL32(__VA_ARGS__))
15 #define __EVAL32(...) __EVAL16(__EVAL16(__VA_ARGS__))
16 #define __EVAL16(...) __EVAL8(__EVAL8(__VA_ARGS__))
17 #define __EVAL8(...) __EVAL4(__EVAL4(__VA_ARGS__))
18 #define __EVAL4(...) __EVAL2(__EVAL2(__VA_ARGS__))
19 #define __EVAL2(...) __EVAL1(__EVAL1(__VA_ARGS__))
20 #define __EVAL1(...) __VA_ARGS__
22 #define EMPTY()
24 #define DEFER(macro) macro EMPTY()
26 #define SIZE_C(c) CAT(CAT(UINT,__WORDSIZE),_C(c))
28 #endif // MACROS_H_