Avoid using deprecated API in macros