Switch FIX_CMP from a macro to a function