Refactored all #define in compatibility.h to inline functions