use if flag instead of ifdef