#include <stdio.h>
#define DEFINE_TYPE(T) \
typedef struct _type##T { \
T value; \
} Type##T;
#define TYPE(T) Type##T
#define DEFINE_FUNC(T) \
T func##T(T v) { \
return v + (T)1; \
}
#define FUNC(T,V) func##T(V)
DEFINE_TYPE(int)
DEFINE_TYPE(char)
DEFINE_FUNC(int)
DEFINE_FUNC(char)
int main(void) {
TYPE(int) x;
TYPE(char) y;
x.value = 10;
y.value = 'a';
printf("%d\n", FUNC
(int, 25));
printf("%c\n", FUNC
(char, 'X'));
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgojZGVmaW5lIERFRklORV9UWVBFKFQpIFwKdHlwZWRlZiBzdHJ1Y3QgX3R5cGUjI1QgeyBcCglUIHZhbHVlOyBcCn0gVHlwZSMjVDsKCQojZGVmaW5lIFRZUEUoVCkgVHlwZSMjVAoKI2RlZmluZSBERUZJTkVfRlVOQyhUKSBcClQgZnVuYyMjVChUIHYpIHsgXAoJcmV0dXJuIHYgKyAoVCkxOyBcCn0KCiNkZWZpbmUgRlVOQyhULFYpIGZ1bmMjI1QoVikKCkRFRklORV9UWVBFKGludCkKREVGSU5FX1RZUEUoY2hhcikKCkRFRklORV9GVU5DKGludCkKREVGSU5FX0ZVTkMoY2hhcikKCmludCBtYWluKHZvaWQpIHsKCQoJVFlQRShpbnQpIHg7CglUWVBFKGNoYXIpIHk7CgkKCXgudmFsdWUgPSAxMDsKCXkudmFsdWUgPSAnYSc7CgkKCXByaW50ZigiJWRcbiIsIHgudmFsdWUpOwoJCglwcmludGYoIiVjXG4iLCB5LnZhbHVlKTsKCQoJcHJpbnRmKCIlZFxuIiwgRlVOQyhpbnQsIDI1KSk7CgkKCXByaW50ZigiJWNcbiIsIEZVTkMoY2hhciwgJ1gnKSk7CgkKCXJldHVybiAwOwoJCn0K