Wrap the content of macro with do/while to make it safer as per code review comment