Using statement expressions and the typeof extension, you are able to write function-like, type-generic, scope-insensitive macros like this one:
#define MAX(a,b) ({ \
typeof (a) _a = (a); \
typeof (b) _b = (b); \
_a > _b ? _a : _b; \
})
The inability to write template functions can be compensated by designing your function so that it takes a function pointer where the type-specific action occurs.