Simplified variable-size array macros
This commit is contained in:
@ -55,6 +55,17 @@
|
||||
#define NUMERIC_SIGNED(a) (NUMERIC(a) || (a) == '-')
|
||||
#define COUNT(a) (sizeof(a)/sizeof(*a))
|
||||
|
||||
// Macros for initializing arrays
|
||||
#define ARRAY_6(v1, v2, v3, v4, v5, v6, args...) { v1, v2, v3, v4, v5, v6 }
|
||||
#define ARRAY_5(v1, v2, v3, v4, v5, args...) { v1, v2, v3, v4, v5 }
|
||||
#define ARRAY_4(v1, v2, v3, v4, args...) { v1, v2, v3, v4 }
|
||||
#define ARRAY_3(v1, v2, v3, args...) { v1, v2, v3 }
|
||||
#define ARRAY_2(v1, v2, args...) { v1, v2 }
|
||||
#define ARRAY_1(v1, args...) { v1 }
|
||||
|
||||
#define _ARRAY_N(N, args...) ARRAY_ ##N(args)
|
||||
#define ARRAY_N(N, args...) _ARRAY_N(N, args)
|
||||
|
||||
// Macros for adding
|
||||
#define INC_0 1
|
||||
#define INC_1 2
|
||||
|
Reference in New Issue
Block a user