Convert some macros to static inlines