extract compiler flag check as external macro