Reorder macros to make sure they are declared before being used