The max macro in the example you linked needs an extra pair of parentheses.
You have:
#define max(x, y) ((x) > (y)) ? (x) : (y)
In your example, this expands to:
h = y + h - ((0) > ((y+h)-ih)) ? (0) : ((y+h)-ih);
I believe the operator precedence means that everything on the left is subsumed into the condition expression for the ternary operator. There's some implicit conversion from bool to int and back again, resulting in an always-true condition, so you then get the true branch, which is simply 0.
Your macro should be:
#define max(x, y) (((x) > (y)) ? (x) : (y))