I think the right solution is to #include "fmath.h", and fix/augment the isnan/isinf definitions that are there. Also, I'd prefer to use 'using' wherever possible, rather than define macros.