moved ifdef outside functions to avoid gcc errors