#include <stdio.h>
#define ARRAY int, float
#define GET_1(_1) _1
#define GET_2(_1,...) GET_1(__VA_ARGS__)
#define GET_3(_1,...) GET_2(__VA_ARGS__)
#define GET_N2(_3,_2,_1,N,...) GET##N
#define GET_N(...) GET_N2(__VA_ARGS__,_3,_2,_1)
// GET idx argument from comma separated tokens
#define GET(array, idx) GET_N(array)(array)
int main() {
printf("%zu\n", sizeof(GET(ARRAY, 0)));
}
#include <stdio.h>
struct type_property {
size_t size;
};
#define TYPE_PROPERTY_INIT(type) { sizeof(type) }
struct type_property properties[] = {
TYPE_PROPERTY_INIT(int),
TYPE_PROPERTY_INIT(float),
};
int main() {
printf("%zu\n", properties[0].size);
}
#define variadic t_array = [ int, float ];
t_array[0]