This:
type##_gtr
inside the macro is glueing together the value of the type
argument with the text _gtr
. This happens between the return type and the opening parenthesis of the argument list, i.e. this forms the name of the function.
So if you use GTR(unsigned int)
, you fail since the full function prototype ends up looking like this:
unsigned int unsigned int_gtr(unsigned int a, unsigned int b)
which is not syntactically correct. Basically, the macro has a weakness in that it assumes type names cannot contain spaces, which is not true in C.
If you use GTR(unsigned)
, though, you should call it as unsigned_gtr()
.
void main()
is not allowed by standard C. You should useint main()
instead. – hugomg