adapted to gcc