made code portable between gcc versions