Fix compile on BSD systems