Add compare macro

This macro returns 1 if a > b, -1 if a < b, otherwise 0.