Yeah, there's plenty of precedent for that coding if you look around. I've not read the whole patch, but this snippet seems fine to me if there's also an #undef at the end of the function.
pgsql-hackers by date:
Соглашаюсь с условиями обработки персональных данных