On GCC with -ffast-math standard library IsInf/IsNan/IsFinite fail, so implement them manually for all platforms.