fix compiling on freebsd